0

We have our custom button that is ASP.NET custom server control. We use it on all our pages for action buttons (< NS:OurButton ID='btn' runat="server" Text="Search"/ >).

Now we want to use that button to open our custom search form to filter the records in jqGrid. Our business requirement that the search button must be a part of jqGrid pager.

How I can do it? I tried to search google and wiki help for jqGrid, but didn't found any way how to add that custom search button to the jqGrid pager.

If it's matters, the button rendered to the client in that markup:

<div id="btn" class="OurCustomButton">
    <div class="LeftSide"></div>
    <div class="ButtonContent">Search</div>
    <div class="RightSide"></div>
</div>

Or maybe it's possible to create totally my own custom pager, with my own design and buttons and then to tell the jqGrid to use it's controls as triggers or to trigger events on my own with correct parameters?

4

1 回答 1

0

我能想到的一种解决方案是使用 jQuery 的insertBefore()(或insertAfter)并将您的按钮的 html 插入到 document.ready() 事件中。

代码可以是:

jQuery(document).ready(function(){ 
$('<div class="ButtonContent">Search</div>').insertBefore('.RightSide');
});
于 2012-08-27T15:31:05.503 回答