PDA

View Full Version : Groupby Grid broken into pieces after remote sort with different GroupBy field



alexaung
15 Mar 2011, 1:57 AM
Hi All,

I have Grouping Grid. It is working fine at frist time. But After I sort with field that is not group by field then group by is broken into pieces even same group. Pls look at my image. Groupby with "Report Date" and Sorted by with "SeaStaffName" but showing in two groups after sorted out by "SeaStaffName" column.



var reader = new Ext.data.JsonReader({
idProperty: 'CrewDisciplineWarningId',
totalProperty: 'result.count',
root: 'result.data'
}, [
{ name: 'CrewDisciplineWarningId' },
{ name: 'ReportNumber' },
{ name: 'ReportDate' },
{ name: 'VesselName' },
{ name: 'Offender.FullName' },
{ name: 'CurrentActivityDisplayMessage' }
]);
?
var cdwGroupingStore = new Ext.data.GroupingStore({
reader: reader,
proxy: new Ext.data.HttpProxy({
method: 'POST',
disableCaching: false,
url: "../../Proxy/CrewDisciplineWarning.svc/SearchCrewDisciplineWarning"
}),
autoLoad: false,
sortInfo: { field: 'ReportDate', direction: "ASC" },
remoteSort: true,
remoteGroup: true,
groupField: 'ReportDate'
});
cdwGroupingStore.on('beforeload', function (store, options) {
options.params.jsonData = Ext.encode(Ext.applyIf({ "objCrewDisciplineWarningSearchCriteriaDto": getCDWCriteria(options.params) }));
});



grdCDWList = new Ext.grid.GridPanel({
store: cdwGroupingStore,
columns: [
{ header: "Vessel", width: 25, sortable: true, dataIndex: 'VesselName' },
{ header: "Report ID", width: 10, sortable: true, dataIndex: 'ReportNumber', renderer: renderLink },
{ header: "Report Date", width: 20, sortable: true, dataIndex: 'ReportDate', renderer: Ext.util.Format.dateRenderer($Constants.myDateFormat) },
{ header: "SeaStaff Name", width: 25, sortable: true, dataIndex: 'Offender.FullName' },
{ header: "Status", width: 20, sortable: true, dataIndex: 'CurrentActivityDisplayMessage' }
],
view: new Ext.grid.GroupingView({
forceFit: true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
frame: true,
split: true,
loadMask: false,
autoScroll: true,
viewConfig: {
forceFit: true
},
//title: 'Inbox',
autoHeight: true,
columnLines: true,
collapsible: true,
animCollapse: false,
//enableHdMenu: false,
fbar: ['->', {
text: 'Clear Grouping',
iconCls: 'icon-clear-group',
handler: function () {
cdwGroupingStore.clearGrouping();
}
}],
// put paging bar on the bottom
bbar: pagingBar,
listeners: {
cellclick: function (grid, rowIndex, columnIndex) {
// Get the Record for the row
var record = grid.getStore().getAt(rowIndex);
// Get field name for the column
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
if (fieldName == 'ReportNumber')
viewReport(record.data);
}
}
});

alexaung
15 Mar 2011, 2:05 AM
Sorry Guys,

Error image is here.