I need to use drag and drop and when I click my row to begin the drag an error is thrown in the getDragData function. This is the original function, not overridden. The code to create my grid is below. That is from my ui file. Any ideas are appreciated. I didn't see isSelected as a method belonging to the selModel, but maybe I am missing it. I have very similar logic working for other grids so I assume the ext js framework is not the issue. Any ideas are appreciated!
Code:
getDragData : function(e){
var t = Ext.lib.Event.getTarget(e);
var rowIndex = this.view.findRowIndex(t);
if(rowIndex !== false){
var sm = this.grid.selModel;
if(!sm.isSelected(rowIndex) || e.hasModifier()){//blows up here, isSelected is not a defiend //method
sm.handleMouseDown(this.grid, rowIndex, e);
}
return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
}
return false;
},
Code:
Ext.ns('CMA');
CMA.PartyAddressGridUi = Ext.extend(Ext.grid.EditorGridPanel, {
frame: true,
loadMask: true,
stripeRows: true,
header: true,
enableColumnHide: false,
enableColumnMove: false,
enableDragDrop: true,
ddGroup: 'addressDDGroup',
initComponent: function() {
this.columns = [
Ext.create({
width: 115,
xtype: 'cmaAddressTypeColumn'
}),
Ext.create({
id: 'addressGridAddressColumn',
xtype: 'cmaAddressColumn'
}),
Ext.create({
width: 65,
xtype: 'cmaEffectiveDateColumn'
}),
Ext.create({
width: 65,
xtype: 'cmaAddressValidFromColumn'
}),
Ext.create({
width: 55,
xtype: 'cmaAddressValidToColumn'
})
];
this.tbar = {
xtype: 'toolbar',
height: 23,
items: [
{
xtype: 'tbtext',
text: 'Addresses'
},
{
xtype: 'tbseparator'
},
{
xtype: 'button',
text: 'Add',
iconCls: 'icon-plus',
ref: '../addButton'
}
]
};
this.view = new Ext.grid.GridView({
forceFit: true,
deferEmptyText: false,
emptyText: '<div class="cma-error">Residence Address Required.</div>'
});
CMA.PartyAddressGridUi.superclass.initComponent.call(this);
}
});