dragging table cells between 2 tables #48

Closed
sanchitbareja opened this Issue Oct 21, 2013 · 1 comment

Comments

Projects
None yet
2 participants

I've used jquey sortable before and love it!

this time round, I wanted to be able to create a draggable cell between 2 tables. I.e.

how do I move the content of a cell from 1 table to another? I specifically only want to copy the content over into an existing cell on another table. It shouldn't remove my previous cell and it shouldn't create a new cell in the new table. The cells in the table are already created but empty initially.

Owner

johnny commented Oct 21, 2013

This is impossible to achieve at the moment for two reasons, I think:

  1. The placeholder will be put in the wrong place. It should point to the cell the content will be put in, but it is pointing before or after the cell
  2. There is no way to find out, what cell the pointer is closest to.

The latter issue is an API problem. I could make this available inside the afterMove callback. But the former issue can not be fixed easily (at least I can not think of anything which will fit well with the rest of the plugin).

You are always welcome to hack the source, to give it a try. It should not be too hard. You would have to change the movePlaceholder method.

movePlaceholder: function (container, item, method, sameResultBox) {
var lastAppendedItem = this.lastAppendedItem
if(!sameResultBox && lastAppendedItem && lastAppendedItem[0] === item[0])
return;
item[method](this.placeholder)
this.lastAppendedItem = item
this.sameResultBox = sameResultBox
this.options.afterMove(this.placeholder, container)
},

@johnny johnny closed this in 34c28dc Jan 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment