PDA

View Full Version : Grid with GroupingStore not querying the webserver



KallDrexx
15 Dec 2010, 9:06 PM
I'm confused on how to get my GroupingStore to query the webserver.



MyApp.grids.RelationshipMemberGrid = Ext.extend(Ext.grid.GridPanel, {
autoHeight: true,
iconCls: 'icon-grid',
title: 'Relationship Members',
frame: true,
viewConfig: { forceFit: true },
relationshipId: null,
documentId: null,

initComponent: function () {
if (this.verifyParameters()) {
// Initiate functionality
this.columns = this.buildColumns();
this.view = this.buildView();
this.store = this.buildStore();
}

MyApp.grids.RelationshipMemberGrid.superclass.initComponent.call(this);
},

verifyParameters: function () {
if (this.relationshipId == null || this.relationshipId < 1) {
Ext.MessageBox.alert('Error', 'Relationship Id is not valid');
return false;
}

if (this.documentId == null || this.documentId < 1) {
Ext.MessageBox.alert('Error', 'Document Id is not valid');
return false;
}

return true;
},

buildColumns: function () {
return [{
header: 'Id',
dataIndex: 'Id',
sortable: true,
width: 10
}, {
header: 'Type',
dataIndex: 'ObjType',
sortable: true,
width: 10
}, {
header: 'Name',
dataIndex: 'Name',
sortable: true
}];
},

buildView: function () {
return new Ext.grid.GroupingView({
forceFit: true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Members" : "Member"]})'
});
},

buildStore: function () {
return new Ext.data.GroupingStore({
url: MyAppUrls.ListRelationshipMembers,
params: { relationshipId: this.relationshipId },
fields: ['Id', 'ObjType', 'Name'],
sortInfo: { field: 'Name', direction: 'ASC' },
groupField: 'ObjType'
});
}
});


No javascript errors seem to occur but no http calls are made. The MyAppUrls.ListRelationshipMembers contains a valid string with the correct URL.