Adding jqgrid navButtonAdd badge to top (cloned) navigator

I am using navButtonAdd to select a column in jqgrid, but it adds a button to the bottom navigation bar. Is it possible to add the same icon to the top of my cloned navigation bar. Here is my code ...

jQuery("#grid").jqGrid({
         ......
         toppager: true,
         ....
    );  

jQuery("#grid").jqGrid('navGrid','#pager',
    {cloneToTop: true, edit:false, add:false, del:false, search:false},
        { }, { }, { }, { } );

jQuery("#grid").jqGrid('navButtonAdd', '#pager', {
    caption : "",
    buttonicon : "ui-icon-calculator",
    title : "Choose Columns",
    onClickButton : function() {
        jQuery("#grid").jqGrid('columnChooser');
    }
});
0
source share
2 answers

If the creator is created, it will have an identifier built from the grid identifier and "_toppager", so in your case it will be "grid_toppager". Therefore you should use

jQuery("#grid").jqGrid('navButtonAdd', '#grid_toppager', {...});

See here and here for more details and for demos.

+2
source

toppager: true cloneToTop: true , .

$("#list").jqGrid({
    pager: '#pager',toppager: true  
});

$("#list").jqGrid('navGrid',"#pager",{
    cloneToTop:true
});
0

All Articles