Note that there are some explanatory texts on larger screens.

plurals
  1. POAre Groups can be sorted other than alphabetically in JqGrid
    primarykey
    data
    text
    <p>I'm getting response from server that gives data in grouping in a specific order. But when I load that data in my jqGrid it automatically sort groups in alphabetically order, and I want the order in which server provided me data.</p> <p>For example I'm getting data in three groups i-e university , college , school</p> <p>Now this can be sorted as increasing order i-e college , school , university </p> <p>Or</p> <p>Can be sorted as decreasing order i-e university , school , college</p> <p>What should I do so that the order will remain in the same order as I'm getting it back from server?</p> <p>I want to make some addition the response of server is stored in an object and then I load that data in a grid so I guess its local data... Sorry I'm new to jqGrid </p> <p>Here is my code for jqgrid.</p> <pre><code>GRID = $("#"+GRID_ID).jqGrid({ url: sample, datatype: 'json', jsonReader : { root:"rows", page: "page", total: "total", records: "records", //repeatitems: false, }, colNames: ['File', 'UID', 'Order', 'Type', 'Project','Method', 'Phase' , 'Group'], colModel: [{ name: 'file', index: 'file', width: 140 }, { name: 'uid', index: 'uid', width: 80 }, { name: 'order', index: 'order', width: 60, sortable:true }, { name: 'type', index: 'type', width: 75, editable:true, edittype:"select", editrules: { required: true } }, { name: 'project', index: 'project', width: 100, editable:true, edittype:"select", editrules: { required: true } }, { name: 'method', index: 'method', width: 60, editable:true, edittype: "select", editrules: { required: true }, //editoptions: { size: 71} },{ name: 'phase', index: 'phase', width: 75, editable:true, edittype:"select", editrules: { required: true } },{ name: 'group', index: 'group', width: 75, sortable: false, hidden:false }], loadComplete: function() { $("#"+GRID_ID).setColProp('type', { editoptions: { value: types} }); $("#"+GRID_ID).setColProp('project', { editoptions: { value: project} }); }, //rowNum: 10, autowidth: true, rowList: [10, 50, 100], pager: $("#"+PAGER_ID), loadonce: true, sortname: 'order', viewrecords: true, sortOrder: "asc", multiSort: false, pgbuttons: true, pginput: true, cellEdit: true, cellsubmit : 'clientArray', editurl: 'clientArray', height: "100%", toolbar: [true, "bottom"], grouping:true, groupingView : { groupField : ['group'], groupDataSorted : true, groupSorted:false, groupColumnShow:[true], sortable:false }, caption: 'JqGrid Examples' }).navGrid("#"+PAGER_ID, { edit: false, add: false, del: false }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload