Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dragging table cells between 2 tables #48

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

dragging table cells between 2 tables #48

sanchitbareja opened this issue Oct 21, 2013 · 1 comment

Comments

@sanchitbareja
Copy link

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.

@johnny
Copy link
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 as completed in 34c28dc Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants