I am using the MVC framework. I need to implement a grid with rows that can be reordered. The gridviewdragdrop plugin looks like it's simple enough to implement. However, right of the bat I am already encountering an error.
When I click on a row (not even dragging), I get and error view.getItemSelector is not a function. It looks like when the row is clicked, onItemMouseDown is called which then calls getDragData. In debug mode, the value for view.itemSelector is "tr.x-grid-row". However, inside getDragData, view.itemSelector is undefined. I'm puzzled as to how it to lost in between the calls. Is there something obvious that I am missing?
Unfortunately, I cannot post my full code here. But this is closed to what I have.
Code:
Ext.define('myproject.employees') {
model: 'mypoject.employee',
data: [
{name: 'john', title: 'system engineer'},
{name: 'jane', title: 'manager'}
]
}
Ext.define('myproject.employeeGrid') {
requires: [
'myproject.employees',
'Ext.grid.plugin.DragDrop'
],
plugins: [
{
ptype: 'gridviewdragdrop'
}
],
store: 'myproject.employees',
layout: 'fit'
initComponent: function() {
stateful: true,
cls: 'custom-grid'
columns: [
{
text: 'Name',
dataIndex: 'name',
},
{
text: 'Job Title',
dataIndex: 'title',
}
]
}
this.callParent();
}