Adding button to jqGrid top toolbar

前端 未结 4 1699
梦毁少年i
梦毁少年i 2020-12-10 07:55

Looks like the default toolbar for jqGrid is always at the bottom. Buttons like Next/Prev page and the dropdown to select the number of rows per page will always show at the

4条回答
  •  执念已碎
    2020-12-10 08:22

    To have the toolbar at the top of the grid with the same buttons and events as the bottom toolbar you must activate the toppager:true to the definition of the grid and add the next lines after the definition

    /** Duplicating the Nav Toolbar in top **/
    var toolbarClone = $('#pager_left').clone(true);
    // Assuming that your grid's ID is myGrid
    $('#myGrid_toppager_left').prepend(toolbarClone);
    

    Those lines will do the trick :)

提交回复
热议问题