ExtJs 4 - Drag and Drop in the Same Grid

How do you reorder grid rows in ExtJs 4 by dragging and dropping? And is that possible? I see that there is an example of dragging grid lines between two grids on the ExtJs example page, but I seem to be unable to figure out how to use this and make it work in only one grid.

I would be grateful for your help.

Thanks.

+7
source share
2 answers

OK, so I just figured it out. It was pretty simple actually ... I just needed to add

plugins: { ptype: 'gridviewdragdrop' } 

in gridviewConfig and it works fine.

Please do not bother this question with a question. Sorry, I didn’t look for an answer before posting this question and should have answered my own question, but I hope that the answer will help someone else if you are looking for a solution to the same problem.

+14
source
 plugins: { ptype: 'gridviewdragdrop',dragText:'Reorder Rows' }, // to save position listeners:{ drop:function(){ Ext.Ajax.request({ url:'url-to-save-position', params:{ value:Ext.encode(Ext.pluck(grid.getStore().data.items, 'data')) } }) } } 
+2
source

All Articles