tags:

views:

177

answers:

1
+1  Q: 

jqgrid won't sort

hi, i have a jqgrid to display data, however it won't sort, i followed the examples provided by jqgrid, did i miss anything?

jQuery("#list-table").jqGrid({
    url:'data/getJSONFile.php?set='+setName+'&list='+listName,
    datatype: "json",
    colNames:['id', 'title','author','publisher'],
    colModel:[
    {name:'id',index:'id',width:55, sortable:true},
        {name:'title',index:'title',width:150,sorttype:'string'},
        {name:'author',index:'author', width:150},
        {name:'publisher', index:'publisher', width:200}
    ],
    rowNum:10,
    //autowidth:true,
    width: 800,
    rowList:[10,20,30],
    pager:jQuery('#pager1'),
    sortname:'id',
    viewrecords: true,
    sortorder: "desc",
    caption:"books list"
    });
    jQuery("#list-table").jqGrid('navGrid', '#pager1',{edit:false, add:false,del:false});
A: 

See jqgrid-sorting-on-client-side

Justin Ethier