3

i see in jqgrid you can move the pager up to the top of the grid and the default buttons but i wanted to see if you can move the entire row (including buttons default and custom along with the pager) to the top above the grid ?

if i use clonetoTop it only moves the regular buttons but not ones that i add dynamically

Update:


As you can see below, i added my own personal RefreshGrid button using this code and its not showing up at top:

 .navButtonAdd('#pager', {
            caption: "",
            title: "Reload Grid",
            buttonicon: "ui-icon-refresh",
            onClickButton: function () {
                $(gridSelector).trigger("reloadGrid");
            },
            position: "last"
        });

enter image description here

leora
  • 188,729
  • 360
  • 878
  • 1,366

1 Answers1

4

The parameter cloneToTop:true of the navGrid do what you need:

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

See here and here for additional information.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • that doesn't seem to copy the custom button to the top. I have put a screenshot in the question after adding cloneToTop to show you the issue. As you can see the refresh grid button that i added is not being cloned – leora Sep 02 '11 at 01:11
  • 1
    [Here](http://stackoverflow.com/questions/3929896/adding-jqgrid-custom-navigation-to-top-toolbar/3932314#3932314) and [here](http://stackoverflow.com/questions/5518646/add-buttons-to-a-new-top-toolbar/5524152#5524152) you will find the corresponding examples. Because the `navButtonAdd` should be called **after** the `navGrid` the `navGrid` clone only the buttons which exist at the moment. So you should just use `mygrid.jqGrid('navButtonAdd', '#'+mygrid[0].id+"_toppager", options)` to add custom button to the toppager. – Oleg Sep 02 '11 at 07:16