Hi,
i'm working with Combobox with mode 'remote' in Grid with RowEditor plugin. Grid is in Window. When I first time open window all is ok. But after I close window and try to open it again I get an error message in Firebug:
this.store is null
[IMG]chrome://firebug/content/blank.gif[/IMG] if(this.store.getCount() > 0){\n (ext-all-debug.js (Zeile 32918))
Why? Thank's for your help!
Here is my code:
Code:
Ext.util.Format.comboRenderer = function(combo){
return function(value){
var record = combo.findRecord(combo.valueField, value);
return record ? record.get(combo.displayField) : combo.valueNotFoundText;
}
}
var Combo = new Ext.form.ComboBox({
editable: false,
//typeAhead: true,
triggerAction: 'all',
lazyRender:true,
listClass: 'x-combo-list-small',
displayField: 'item',
valueField: 'id',
store: new Ext.data.ArrayStore({
autoLoad: true,
restful: true,
idIndex: 0,
fields: ['id','item'],
url: '/fm/combo/599',
listeners: {
load: function(store,rs) {
alert("Loaded: "+rs.length);
}
}
}
});
.... I use Web Desktop sample...
createWindow : function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('bogus'+src.tableId);
if(!win){
alert(Combo.store.getCount()); // gets 3 - store is Ok!
var gridCfg = {
id: 'table'+src.tableId,
store: new Ext.data.Store({
storeId: 'store'+src.tableId,
autoLoad: true,
restful: true,
proxy: new Ext.data.HttpProxy({
url: '/fm/tables/'+src.tableId,
restful: true
}),
reader: new Ext.data.JsonReader({root:'data'}),
writer: new Ext.data.JsonWriter()
}),
cm: new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: src.cm
/* part of src.cm:
...
header: 'Status',
dataIndex: 'status_id',
editor: Combo,
renderer: Ext.util.Format.comboRenderer(Combo)
....
*/
}),
view: new Ext.ux.BufferView({
rowHeight: 21,
scrollDelay: false,
markDirty: false
}),
iconCls: ''
};
win = desktop.createWindow({
id: 'bogus'+src.tableId,
title:src.text,
width:640,
height:200,
iconCls: 'bogus',
shim:false,
animCollapse:false,
constrainHeader:true,
layout: 'fit',
items: new Ext.grid.GridPanel(gridCfg)
});
}
win.show();