PDA

View Full Version : [Solved]GroupingStore first I missed somthing



michaelc
17 Sep 2009, 12:53 PM
Did a search, but I don't see anything.
I tried to add the GroupingStore to my JSON grid and nothing shows, don't know what to debug with in this case. Seems really simple based on the example.

I used the same store just changed the store in the actual grid and now no data shows but the grid itself does show.



//Store that holds the services for an application
var applicationListStore = new Ext.data.JsonStore({
fields: [{
name: 'code',
mapping: 'code'
}, {
name: "componentCode",
mapping: 'componentCode'
}, {
name: "componentName",
mapping: 'componentName'
}, {
name: "core",
mapping: 'core'
}, {
name: "description",
mapping: 'description'
}, {
name: "internal",
mapping: 'internal'
}, {
name: "licenseEffectiveDate",
mapping: 'licenseEffectiveDate',
type: 'date'
}, {
name: "licenseExpirationDate",
mapping: 'licenseExpirationDate',
type: 'date'
}, {
name: "licenseType",
mapping: 'licenseType'
}, {
name: "name",
mapping: 'name'
}]
});

applicationListStore.loadData(object.dataObject.service);

// ----------------------------------------------------------
// Basic Grid Panel that shows all licenses
//-----------------------------------------------------------
var applicationListGrid = new Ext.grid.GridPanel({
border: false,
id: this.moduleName + '-tabpanel-search-tab-licenselist-grid',
height: 400,

viewConfig: {
forceFit: true
},
// ds: applicationListStore,
ds: new Ext.data.GroupingStore({
reader: applicationListStore,
sortInfo: {
field: 'componentName',
direction: "ASC"
},
groupField: 'componentName'
}),
view: new Ext.grid.GroupingView({
forceFit: true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),

cm: new Ext.grid.ColumnModel([{
header: 'Code',
width: 80,
sortable: true,
dataIndex: 'code'
}, {
header: 'Component Code',
width: 80,
sortable: true,
dataIndex: 'componentCode'
}, {
header: 'Component Name',
width: 80,
sortable: true,
dataIndex: 'componentName'
}, {
header: 'Core',
width: 100,
hidden: true,
sortable: true,
dataIndex: 'core'
}, {
header: 'Description',
width: 50,
hidden: true,
sortable: true,
dataIndex: 'description'
}, {
header: 'Internal',
width: 50,
hidden: true,
sortable: true,
dataIndex: 'internal'
}, {
header: 'Effective Date',
width: 100,
sortable: true,
dataIndex: 'licenseEffectiveDate',
renderer: formatDate
}, {
header: 'Expiration Date',
width: 100,
sortable: true,
dataIndex: 'licenseExpirationDate',
renderer: formatDate
}, {
header: 'License Type',
width: 70,
hidden: true,
sortable: true,
dataIndex: 'licenseType'
}, {
header: 'Service Name',
width: 70,
sortable: true,
dataIndex: 'name'
}])
});

evant
17 Sep 2009, 4:27 PM
You've declared the reader for your GroupingStore as JsonStore. I think you meant to have JsonReader?

michaelc
17 Sep 2009, 5:20 PM
You've declared the reader for your GroupingStore as JsonStore. I think you meant to have JsonReader?

found it thanks