我有jqgrid。我根据列值对几行进行分组。工作演示可在限定的jqGridjqGrid排序列同时分组考虑分组标题
var preclosingtable = $('#preclosing');
preclosingtable.jqGrid({
datatype: 'local',
data: data.DOCS,
colNames: ['', 'Documents Received', 'Comments', 'NA', 'DocGroup'],
colModel: [
{ name: 'Documents', index: 'Documents', align: 'left', sortable: false, editable: false, width: 20 },
{ name: 'DocsReceived', index: 'DocsReceived', align: 'center', sortable: false, editable: true, edittype: 'checkbox', editoptions: { value: "True:False" }, formatter: "checkbox", width: 140 },
{ name: 'Comments', index: 'Comments', align: 'center', sortable: false, editable: true, edittype: "textarea", editoptions: { rows: "3", cols: "16" }, width: 180 },
{ name: 'NA', index: 'NA', editable: true, formatter: 'dynamicText', width: 150, edittype: 'custom', editoptions: { custom_element: radioelem, custom_value: radiovalue} },
{ name: 'DocGroup', index: 'DocGroup', editable: false, width: 1 }
],
rowNum: data.DOCS.length,
//rowList: [10, 20, 30],
pager: '#preclosingpagerdiv',
viewrecords: true,
sortorder: "asc",
sortname: 'Documents',
grouping: true,
groupingView: {
groupField: ['DocGroup'],
groupColumnShow: [false],
groupDataSorted: true,
groupOrder : 'asc'
},
localReader: {
id: 'ConfigId'
},
shrinkToFit: false,
height: 'auto',
loadComplete: function() {
HideGroupHeaders(this);
},
onSelectRow: function (id) {
preclosingtable.jqGrid('saveRow', previouslyselectedRow, false, 'clientArray');
previouslyselectedRow = SetJQGridRowEdit(id, previouslyselectedRow, preclosingtable);
}
});
代码link 部分以下是我的网看起来像
问题:是否有可能在这个网格行进行排序,以便在最后一格在下列顺序排
- 阿拉巴马
- d
- 缅因州
- 新泽西州
- Q
- 弗吉尼亚
感谢@Oleg结果。有效。 – fcmaine 2013-04-25 18:15:01
@SrinivasPotluri:不客气!一个常见的评论:你应该使用更有效的投票权。在11个月中,你只用了5次。投票是搜索引擎的主要标准,因为这个想法是* stackoverflow的用户*决定哪些信息(答案或问题)*有用*。您有权每天投票30个问题或答案**(请参阅[这里](http://meta.stackexchange.com/a/5213/147495))。所以,如果你看到一些关于stackoverflow的信息,你会发现*有用*和**,如果你想帮助其他用户找到信息,你应该把它投票给**。 – Oleg 2013-04-25 18:29:16
@Oleg我认为必须有更好的方式来做到这一点:)我有一个强烈的怀疑,你会进入这个问题,并提供一个更好的答案,然后我的! – Mark 2013-04-25 18:38:34