PDA

View Full Version : grid is undefined in Ext.grid.RowSelectionModel



derekvre
19 Oct 2010, 8:59 AM
There is no grid defined in the RowSelectionModel object of my GridPanel (taken from ExtJS Feed Viewer example).
I would assume that when initializing a RowSelectionModel in the constructor of a GridPanel, the grid property of that RowSelectionModel object should be set to reference the grid in which the RowSelectionModel is living. But the grid property is undefined. Why?

.
.
.
FeedGrid.superclass.constructor.call(this, {
region: 'center',
id: 'topic-grid',
loadMask: {msg:'Loading Feed...'},

sm: new Ext.grid.RowSelectionModel({
singleSelect:true
}),

viewConfig: {
forceFit:true,
enableRowBody:true,
showPreview:true,
getRowClass : this.applyRowClass
}
});
.
.
.
Ext.extend(FeedGrid, Ext.grid.GridPanel, {

plalx
19 Oct 2010, 12:09 PM
Well.. the example works for me? Where are you getting this error? How are you trying to use the FeedGrid?

derekvre
20 Oct 2010, 12:13 PM
Thanks so much for responding scarsick. You are correct, the example works fine but I have been trying to add some further functionality working off the feed example. I did find a work around for my problem so I'm not much concerned about this issue anymore. But if you are interested I was confused about the grid property of the RowSelectionModel, it didn't seem to be populated when the RowSelectionModel was instantiated in the example although maybe I had an error in my testing methods.

It is instantiated on line 50 of the FeedGrid.js:
sm: new Ext.grid.RowSelectionModel({