Re: [qooxdoo-devel] qx.ui.table.Table drag and drop
Brought to you by:
ecker,
martinwittemann
From: Til S. <til...@st...> - 2006-12-06 11:07:18
|
CSBrown wrote: > I am trying to implement drag and drop from the table to another component. > So far, I have only been able to attach an event to the table but that > interferes with resizing and reordering the columns. I don't understand this. Drag and drop happens in the table body. Column resizing and reordering happens in the table header. How does this interfere? > I am trying to intercept the dragstart and cancel it if it originates from > the table header. Also trying to embed html images in the table and use > these to initiate the drag. Adding a dragstart handler to the table should be sufficient. Example: myTable.addEventListener("dragstart", function(evt) { var pageX = evt.getPageX(); var pageY = evt.getPageY(); var tableScroller = myTable.getTablePaneScrollerAtPageX(pageX); if (tableScroller != null) { var row = tableScroller._getRowForPagePos(pageX, pageY); if (row != null && row != -1) { // We are over a row -> Start dragging evt.addData("mytype", getDataFromRow(row)); evt.addAction("move"); evt.startDrag(); } }; }); |