PDA

View Full Version : [SOLVED] cfg has no properties after removing the group field



pantarhei
14 May 2008, 4:04 AM
Hello,
im using a grid with a group view. everything works fine. but if i remove the group field by unchecking the "show in groups" checkbox i cant sort anymore.

sorting the ungrouped grid gives me this error:


cfg has no properties
var groupRenderer = cfg.groupRenderer || cfg.renderer;
ext-all-debug.js (line 31321)

i suppose the error occures in line 31319:


var colIndex = this.cm.findColumnIndex(groupField);
var cfg = this.cm.config[colIndex];

because groupField is false and due of this colIndex is -1
but i have no idea why. any ides whats going wrong here?

here is some code:




var store = new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy({ url: '/fahrzeug/list' }),
reader: new Ext.data.JsonReader({
totalProperty: 'totalCount',
root: "fahrzeuge",
fields: [
{name: 'id' }
,{name: 'ak_intern' }
,{name: 'kennzeichen' }
,{name: 'fahrzeug' }
,{name: 'kmstand' }
,{name: 'status' }
,{name: 'standort' }
,{name: 'farbe' }
,{name: 'kraftstoffart'}
,{name: 'leistung' }
,{name: 'hubraum' }
,{name: 'getriebe' }
,{name: 'ez' }
,{name: 'tuev' }
,{name: 'asu' }
,{name: 'reifengroesse'}
,{name: 'reifenart' }
,{name: 'tueren' }
]}),
sortInfo:{field: 'kennzeichen', direction: "ASC"},
groupField:'standort',
baseParams: {query_all: 'true'},
remoteSort: true,
listeners: {
load: function() {
var gid = gview.getGroupId(session_filiale);
if(Ext.get(gid)) { gview.toggleGroup(gid, true); }
}
}
});



[CODE]
[PHP]
grid = new Ext.grid.GridPanel({
ds: store,
columns: [
{id:'ak_intern', header: "LB Intern", width: 90, sortable: true, dataIndex: 'ak_intern'},
{id:'kennzeichen', header: "Kennzeichen", width: 90, sortable: true, dataIndex: 'kennzeichen'},
{id:'fahrzeug', header: "Fahrzeug", width: 280, sortable: false, dataIndex: 'fahrzeug'},
{id:'kmstand', header: "KM-Stand", width: 70, sortable: true, dataIndex: 'kmstand'},
{id:'status', header: "Status", width: 60, sortable: true, dataIndex: 'status'},
{id:'standort', header: "Standort", width: 150, sortable: true, dataIndex: 'standort'}
],
view: gview,
plugins:[new Ext.ux.grid.Search({
iconCls:'icon-zoom'
,readonlyIndexes:['']
,disableIndexes:['id', 'fahrzeug', 'kmstand',
'status', 'standort', 'farbe', 'kraftstoffart',
'leistung', 'hubraum', 'getriebe', 'ez', 'tuev', 'asu',
'reifengroesse', 'reifenart', 'tueren']
,width: 200
,searchText:'Suche:'
,selectAllText:'Alle Felder'
,searchTipText:'Suchbegriff eingeben und mit ENTER best

pantarhei
15 May 2008, 9:20 AM
just for the records. i used the stores on load function to unfold a certain node.
but if there's no grouping field the function failed.