PDA

View Full Version : EditorGrid + Drap&Drop:JS Error



prodigy7
9 Sep 2009, 1:07 AM
Hi,

I've combined an EditorGridPanel with the "Grid Drag and Drop Reorder Rows" Plugin (http://www.extjs.com/forum/showthread.php?t=21913). When I click now on a cell, I can edit it but I got this message in the background:
c.isSelected is not a function
[Break on this error] var swfobject=function(){var E="undefine...}});Ext.grid.GroupingView.GROUP_ID=1000;ext-all.js (Zeile 11)What does it mean? What's wrong?

Sample can be seen on http://download.prodigy7.de/files/reports/extjs/3.0.0/editdraggrid/array-grid.html

prodigy7

tubamanu
9 Sep 2009, 1:24 AM
i was having the same problem with this plugin yesterday. but i was too lazy to found a solution to get it work....

at the moment i do not use the plugin anymore. i use this for drag drop



this.theRightGrid.on('render', function(grid) {
var secondGridDropTargetEl = grid.getView().scroller.dom;
var secondGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl, {
ddGroup : 'rightGridDDGroup',
copy:false,
notifyDrop : function(ddSource, e, data){
var sm = grid.getSelectionModel();
var rows = sm.getSelections();
var cindex = ddSource.getDragData(e).rowIndex;
for (i = 0; i < rows.length; i++) {
rowData = grid.store.getById(rows[i].id);
if(!this.copy) {
grid.store.remove(grid.store.getById(rows[i].id));
if(cindex) {
grid.store.insert(cindex,rowData);
}
else { // moves items to last position
var totalItems = grid.store.data.length;
grid.store.insert(totalItems,rowData);
}

}
}
}
return true;
}
});
});

prodigy7
9 Sep 2009, 2:46 AM
I found this hint http://www.extjs.com/forum/showthread.php?t=52177 but I don't understand what this should mean. An more specific hint would maybe help.

Edit: Okay ... was too easy. Simply add this
sm: new Ext.grid.RowSelectionModel() on the gridPanel and the error is gone. Source: http://www.extjs.com/forum/showthread.php?t=16124