PDA

View Full Version : Drag and drop grid example



intro
4 Sep 2010, 3:51 AM
Hi i am trying to make grid dragadndrop from json and i want to make something like sort news from web page..
I made grid and i put enable dragadndrop , but i can not find any example for designer grid draganddrop inside grid.

I will be happy if some can post example how to make, because other people can see and learn..
Thanks in advance...

jarrednicholls
6 Sep 2010, 11:42 AM
Hi Vladimir,

Have you see Jay Garcia's example? http://www.sencha.com/forum/showthread.php?9738-Grid-Dnd-drag-and-drop May help out. Are you looking for drag and drop reordering? Or drag and drop from one grid to another? Or from a grid to a tree? In general, it is solved by handling a drag request from a drag zone, and a drop request in a drop zone...which are tied together via a ddGroup name.

intro
6 Sep 2010, 1:27 PM
yes i need drag and drop reodering... i wast trying to implement jgarcia (http://www.sencha.com/forum/member.php?172-jgarcia-tdg-i.com) but i dont know how i can connect grid to dd variables ?

my grid is
this.Novostigrid

and i put


grid=this.Novostigrid;
var ddrow = new Ext.dd.DropTarget(grid.getView().mainBody, {
ddGroup : 'GridDD',
copy:false,
notifyDrop : function(dd, e, data){
var sm=grid.getSelectionModel();
var rows=sm.getSelections();

var cindex=dd.getDragData(e).rowIndex;
if (typeof cindex != "undefined") {
for (i = 0; i < rows.length; i++) {
rowData=ds.getById(rows[i].id);
if(!this.copy) {
ds.remove(ds.getById(rows[i].id));
ds.insert(cindex,rowData);
}
}
sm.selectRecords(rows);
};
}
});

but i still have x when i try to move..

Thanks for your help...

intro
25 Sep 2010, 3:02 AM
Any one help. ??