Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
  <script type="text/javascript">
        $(document).ready(function () {

            
                $("#UsersGrid").GridUnload();
                gridload();
           
        });

        function gridload() {
            jQuery("#UsersGrid").jqGrid({

                url: 'Handler2.ashx' ,
                datatype: 'json',
                mtype: 'POST',
                colNames: ['BusinessUnit','UserId'],
                colModel: [
                   { name: 'BusinessUnit', index: 'Businessunit', width: '450', align: 'center',editable: true},
                   { name: 'UserId', index: 'UserId', width: '60', align: 'center',editable: true,key:true,hidden:true},      
                                
                              
                            ],
                rowNum: 10,
                rowList: [10, 20],
                imgpath: 'Themes', width: "auto", height: "auto",
                pagerpos: 'center',
                ignoreCase: true,
                width: '450',
                gridview: true,
               // sortname: 'TOTALPRICE',
                sortable: false,
                scrollOffset: 0,
                viewrecords: true,
                toppager: true,
                sortorder: 'desc',
               
                pager: '#UsersGridPager' 
                });
  jQuery("#UsersGrid").jqGrid('navGrid', '#UsersGridPager',
            { edit: true, add: true, del: true, search: false, excel: true, exceltext: 'Excel', cloneToTop: true },
            { url: "Handler2Copy.ashx", closeAfterEdit: true },
            { url: "Handler2Copy.ashx", closeAfterAdd: true },
            { url: "Handler2Copy.ashx", closeAfterDel: true },
            { closeAfterSearch: true, closeOnEscape: true, multipleSearch: false, cloneToTop: true });

 $("#UsersGrid").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "eq", toppager: true, cloneToTop: true });
            $("#UsersGrid").jqGrid('navButtonAdd', '#UsersGridPager', { caption: "Filter", title: "Toggle Searching Toolbar", buttonicon: 'ui-icon-pin-s', onClickButton: function () { $("#UsersGrid")[0].toggleToolbar(); } });
            $("#UsersGrid")[0].toggleToolbar();
<pre> };
    

    </script>
Posted

1 solution

this will replicate all bottom buttons to top
XML
You should use toppager:true jqGrid option instead. You don't need define <div id="pager"></div> and use pager: '#pager' parameter. The id of the pager from the top of jqGrid will be "list_toppager" (id of the table element appended with "_toppager").

If you want to add navigator you can use

$("#list").jqGrid('navGrid','#list_toppager');
If you use define <div id="pager"></div> and use pager: '#pager' parameter you will have two pager: one with id="list_toppager" on top of the grid and anothe with id="pager" on the bottom. If you want use both top and bottom pager you can use

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900