I have two grids, and I want to move items from grid to another by double clicking on first grid. I added a listener to first grid and having trouble showing the selected item in second grid
Ext.define('SessionGridPanel', {
extend: 'Ext.grid.Panel',
alias: 'widget.sessiongridpanel',
listeners: {
itemdblclick: function (gridpanel, record, item, e) {
var selectedForm = Ext.create('SelectedPanel');
selectedForm.getStore.add(record);
//selectedForm.getStore().insert(0, [record]);
//selectedForm.getView().getStore().insert(0, record);
}
Below is my second grid
Ext.define('SelectedPanel', {
xtype: 'grid',
itemId: 'myGrid',
id: 'myIdGrid',
extend: 'Ext.grid.Panel',
alias: 'widget.selectedformpanel',
store: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'title', type: 'string' },
{ name: 'approved', type: 'bool' }
]
},
selModel: sm,
columns: [
{
text: 'Id',
xtype: 'gridcolumn',
sortable: true,
dataIndex: 'id'
},
{
text: 'Title',
xtype: 'gridcolumn',
sortable: true,
dataIndex: 'title'
},
{
text: 'Approved',
xtype: 'gridcolumn',
sortable: true,
dataIndex: 'approved'
}
],
dockedItems: [{
xtype: 'container',
cls: 'eformscontainerbutton',
dock: 'top',
items: [{
xtype: 'button',
id: 'moveUp',
action: 'moveUp',
margin: '4 10 4 0',
cls: 'sagitta-deluxe-button',
width: 105,
tooltip: 'Move Up',
text: 'Move Up'
},
{
xtype: 'button',
id: 'moveDown',
action: 'moveDown',
tooltip: 'Move Down',
margin: '4 0 4 10',
cls: 'sagitta-deluxe-button',
width: 105,
text: 'Move Down'
}
]
},
{
// container for the action buttons GENERATE FORMS, VIEW, and CLEAR
xtype: 'container',
cls: 'eformscontainerbutton',
margin: '2 0 2 0',
dock: 'bottom',
items: [
{
xtype: 'button',
id: 'clear',
action: 'clearAll',
tooltip: 'Clear all selections',
margin: '4 3 0 10',
cls: 'sagitta-deluxe-button',
width: 105,
text: 'Clear'
}]
}]
});
I tried to google but couldn't get any thing related to double click, I tried the same way with button click by using store.add and store.insert, but that doesn't work either.