SINGLE ROW
I get this error
this.selections.getAt is not a function
MULTI-ROW
doesn't produce any javascript errors, but the array it returns isn't an array of row id's.
Here is my grid setup code:
var tcs = grid.getSelectionModel().getSelected();
this.selections.getAt is not a function
MULTI-ROW
var tcs = grid.getSelectionModel().getSelections();
Here is my grid setup code:
// preheats grid
var cm = new Ext.grid.ColumnModel([
{header: "ThermoCouple", dataIndex: 'tc', width: 89, sortable: true},
{header: "Target Time", dataIndex: 'time', width: 75, sortable: true}
]);
var record = Ext.data.Record.create([
{name: 'tc', mapping: 'tc'},
{name: 'time', mapping: 'time'},
]);
var reader = new Ext.data.JsonReader({
root: 'result',
id: 'tc',
}, record);
ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'preheat/tc'}),
reader: reader
});
ds.setDefaultSort('tc');
grid = new Ext.grid.Grid('preheats-grid', {
ds: ds,
cm: cm
});
grid.addListener('rowdblclick', viewGraph);
grid.render();

|
#2
|
|
The 2nd is a "documentation hasn't been updated error". It actually returns an array of the full record objects.
getSelected should return 1 record object, but getAt should be itemAt. I have fixed both these issues and will be deploying a new zip shortly. ![]() |
|
#3
|
|
getSelected() returns a MixedCollection.
What is the index property in the MixedCollection? ![]() |
|
#4
|
|
Look at the source for MixedCollection - it's pretty completely documented. You can call item(key), itemAt(index), etc. There's quite a few ways of getting at the data.
__________________
Tim Ryan - Ext JS Support Team Read BEFORE posting a question / posting a Bug Use Google to Search - API / Forum API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide ![]() |
|
#5
|
|
Tim -
here is my code: var deleteRow = sm.getSelected();
deleteRow.each(function(key) {alert(key + ' : ' + deleteRow.get(key));});
deleteRow.get('title')
Any help is appreciated Aaron ![]() |
|
#6
|
|
I haven't done much with this yet, but looking at the code, getSelected returns a Record, not a MixedCollection. Get works b/c Record also has a get method. I would suggest stopping in debug after getSelected and looking at what that object actually is. Maybe it contains the data in a MixeCollection?? - try looking at the internal 'data' property.
__________________
Tim Ryan - Ext JS Support Team Read BEFORE posting a question / posting a Bug Use Google to Search - API / Forum API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide ![]() |
本文探讨了ExtJS中网格组件的选择操作引发的问题,包括单选或多选时出现的错误及解决方案。文中详细分析了使用getSelected和getSelections方法时遇到的具体问题,并提供了调试建议。

被折叠的 条评论
为什么被折叠?



