PDA

View Full Version : Grid Drag/Drop



INeedADip
15 Mar 2007, 2:19 PM
Is it true that the grid doesn't support Draging and Droping Rows?

If I need this functionality should I stick with earlier version of the library?

INeedADip
16 Mar 2007, 11:10 AM
Are there other forums where this library is discussed?

This use to be a great place to get answers and contribute in good discussions about the library. But lately it seems like hardly anyone hangs around here anymore.

When the download link said the library was "discontinued" I didn't know to what extent....
Are there any other forums with Jacks YUIExt as the topic?

Animal
16 Mar 2007, 11:34 AM
yui-ext 0.33 is discontinued. Ext 1.0 is alive and well.

Grid DnD is too new to have experts who'll answer your questions. You'll have to dig into source code, hack around with an experimental page and become an expert yourself!

maya
26 May 2007, 11:09 AM
Can I implement Drag and Drop of Rows in Grid elements?

It seems that when enabling the rows D&D - the columns D&D stops working.

Can you give an example of how to enable both rows and columns D&D on the same Grid?

To enable rows d&d, I am using the following code I found in this forum in the following way:

HTML code:
-------------
<div id="grid_panel" >
<div id="grid_table"></div>
<div id="GridDD"></div>
</div>

JS code:
--------------
var grid = new Ext.grid.Grid('$gridID', {
ds: ds,
cm: colModel,
autoSizeColumns: true,
autoSizeHeaders: false,
trackMouseOver: true,
enableColumnMove: true,
enableDragDrop: true });

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

var cindex=dd.getDragData(e).rowIndex;
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);
};
}
});

var layout = Ext.BorderLayout.create({
center: {
margins:{left:0,top:0,right:0,bottom:0},
panels: [new Ext.GridPanel(grid)]
}
}, 'grid_panel');

grid.render();

Thanks,
Maya