简体   繁体   中英

Sorting issue in jqgrid

the below code code is not sorting but pagination is working.Any solution?

$("#vendor_list").jqGrid({
        url: '/ra/vendor',
        datatype: 'json',
        ignoreCase: true,
        colNames:['Vendor ID','Vendor Code', 'Vendor Name', 'Country', 'Approved', 'Location'],
        colModel:[
                  {name:'Vendor ID',index:'vendor_id', hidden:true},
                  {name:'Vendor Code',index:'vendor_code', sorttype: 'text'},
                  {name:'Vendor Name',index:'vendor_name', sorttype: 'text'},
                  {name:'Country',index:'country', sorttype: 'text'},
                  {name:'Preferred',index:'preferred', align:'center'},
                  {name:'Location',index:'location_flag', align:'center'},
                 ],
        rowNum:5,
        rowList:[5,10,20,30],
        sortable: true,
        loadonce: true,
        mtype: "POST",
        pager: $('#vendor_list_pager'),
        sortname: 'id',
        sortorder: 'asc',
        multiselect: true,
        viewrecords: true,
        gridview: true,
        //onPaging: function(which_button) {
        //  $('#vendor_list').setGridParam({datatype: 'json'});
        //},
        caption:"Vendor Selection List",
});

sortname: 'id'应该是sortname: 'vendor_id'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM