PDA

View Full Version : selModel is undefined



l_aron
1 Sep 2009, 12:41 AM
I'd like to create an EditorGridPanel and checked on the examples. I can't get any of them to work.

Error:
this.selModel is undefined
anonymous()ext-all-debug.js (Line64687)
anonymous()prototype.js (Line 319)


ed.on("specialkey", this.selModel.onEditorKey, this.selModel);

From what I read in the API the selModel in EditorGridPanel gets set automatically to CellSelectionModel, so I don't have to define it.

What can be the problem?
Thanks a lot and here is the code I use:



Ext.onReady(function(){
var cm = new Ext.grid.ColumnModel({
defaults: {
sortable: true
},
columns: [
{
id: 'common',
header: 'Common Name',
dataIndex: 'common',
width: 220,
editor: new Ext.form.TextField({
allowBlank: false
})
}, {
header: 'Light',
dataIndex: 'light',
width: 130
}
]
});

var myData = {
records: [{"common": "Botanica", "light": "Shadow"}]
}

// create the Data Store
var store = new Ext.data.JsonStore({
fields: [
{name: 'common', type: 'string'},
{name: 'light'}
],
data: myData,
root: 'records'

});

//var selModel = new Ext.grid.CellSelectionModel();

// create the editor grid
var grid = new Ext.grid.EditorGridPanel({
store: store,
cm: cm,
//selModel: selModel,
renderTo: 'price_grid',
width: 400,
height: 120,
title: 'Edit Plants',
clicksToEdit: 1
});

store.loadData(myData);
});

15 Sep 2009, 5:51 AM
If the EditorGridPanel automatically creates it, why are you trying to do it manually?

aconran
15 Sep 2009, 6:25 AM
There should be no problem including a selModel or omitting the selection model.

Have you tried the same code without using the prototype adapter and using the standard ext-base adapter?

mgam
10 Nov 2009, 4:23 PM
I am having the same problem. I got the EditorGridPanel sample working on my box. I then modified it to create a ArrayStore (including ArrayReader config settings) and added additional columns that were string inputs. I preloaded one entry. When I bring up my page, the grid displays with my one entry. When I click on a cell from the preload entry row, I get the error:
this.selModel is undefined
anonymous()ext-all-debug.js (line 64687)
anonymous()prototype.js (line 236)
ed.on("specialkey", ...s.selModel.onEditorKey, this.selModel);\next-all-debug.js (line 64687

I didn't add any logic for selection model. It is my understanding that for EditorGridPanel, is defaults to CellSelectionModel.

I would appreciate any help with this issue.

Thanks.

mgam
12 Nov 2009, 9:04 AM
Updating to 3.0.3 fixed the problem.