PDA

View Full Version : Drop between rows



neosky
29 Jan 2014, 4:14 AM
Hello i am have two grids and make drag and drop for transfer rows. But i have problem when i am drop I can only insert a record to the end of grid, if i am insert in other place on grid, them droped row didn"t insert. i am want insert records in any place in the end grid to the beginning grid between the rows, help me! :) Thanks



listeners: {
drop: function(node, data, dropRec, dropPosition) {
console.log(data);
Ext.getCmp('book-add-ret').enable();
},
beforeDrop: function(node, data, overModel, dropPosition, dropHandlers) { records = []
Ext.each(data.records, function(item, index, allItems) {
theStore = node.view.panel.up('window').theStore;
console.log(item.data);
records.push(Ext.create('TPL.model.BookAdd', {
bookId: item.data.id,
authorId: Ext.getCmp('authorId').getValue(),
price: item.data.payload,
seller: theStore.findRecord('id', parseInt(item.data.sellerId)).get('name'), })); });
data.records = records;
return true;
} }

scottmartin
29 Jan 2014, 5:42 AM
This example is allowing for this:
http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#dd-grid-to-grid

Are you sure you do not have a sort setup?