jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Issue with Group function of jxGrid
Tagged: datagrid control grouping
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 7 months ago.
-
Author
-
Hi,
I’m using jxGrid (in 2.5.5 release). I want to use the group function of jxGrid. This is the code that I used to init the jxGrid:
// prepare the data var retsource = { datatype: "array", datafields: [ { name: 'index' }, { name: 'name' }, { name: 'province' }, { name: 'district' }, { name: 'ward' } ], id: 'id', localdata: mapDevSummaryInfos };// ReSharper disable InconsistentNaming var dataAdapter = new $.jqx.dataAdapter(retsource);// ReSharper restore InconsistentNaming $("#divGridResults").jqxGrid({ editable: false, theme: theme, enablehover: false, selectionmode: 'singlerow', groupable: true, showgroupsheader: false, width: '100%', height: '100%', source: dataAdapter, columns: [ { text: 'Id', datafield: 'index', width: '10%' }, { text: 'Tên thiết bị', datafield: 'name', width: '90%' }, { text: 'Tỉnh/TP', datafield: 'province', width: '0%' }, { text: 'Quận/Huyện', datafield: 'district', width: '0%' }, { text: 'Phường/Xã', datafield: 'ward', width: '0%' } ], ready: function() { $("#divGridResults").jqxGrid('hidecolumn', 'province'); $("#divGridResults").jqxGrid('hidecolumn', 'district'); $("#divGridResults").jqxGrid('hidecolumn', 'ward'); }, groups: ['province', 'district', 'ward'] });
However, the result is not as I expected. The district field has not been grouped correctly:
1. the lable of field district is not displayed
http://imageshack.us/photo/my-images/203/grouperror.png
2. there are 06 districts in the sample data, however, they have not been grouped
http://imageshack.us/photo/my-images/831/grouperror2.png
The language that I used in this sample is Vietnamese.
Could you please help to give me your advises on this issue?
Thanks and best regards,
GiapHi Giap,
Could you provide a sample data so we can test your scenario?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi,
Did you have a chance to test it?
Regards,
GiapHi Giap,
In the sample data, you use: disrict instead of disctrict.
The following code:
mapDevSummaryInfos = new Array(); for (idx = 0; idx < mapDevLists.length; idx++) { var row = {}; row['index'] = mapDevLists[idx][0]; row['name'] = mapDevLists[idx][1]; row['province'] = mapDevLists[idx][3]; row['disrict'] = mapDevLists[idx][4]; row['ward'] = mapDevLists[idx][5]; mapDevSummaryInfos[idx] = row; }
should be:
mapDevSummaryInfos = new Array(); for (idx = 0; idx < mapDevLists.length; idx++) { var row = {}; row['index'] = mapDevLists[idx][0]; row['name'] = mapDevLists[idx][1]; row['province'] = mapDevLists[idx][3]; row['district'] = mapDevLists[idx][4]; row['ward'] = mapDevLists[idx][5]; mapDevSummaryInfos[idx] = row; }
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.