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

Getting handle on dropped item, not table in persistState function #64

Open
boofman15 opened this issue Sep 13, 2016 · 3 comments
Open

Comments

@boofman15
Copy link

After a column is dropped I need to call a custom API that stores the new order. I need to get a handle on the column heading just dropped because it has data attributes with data I need to send. Looks like the persistState function just has a handle on the table.

Is there anyway to know which heading was just dropped within the table and get a handle on that?

Glad I found this plugin. Does just about everything I need it to do.

Thanks!

@alejorivera
Copy link

Need this as well! @boofman15 Where you able to figure something out?

@boofman15
Copy link
Author

Sorry @alejorivera, I did not figure this out.

@alejorivera
Copy link

Thanks! If it's still helpful to you (or anyone else), I figured it out. Here's how to get the element that was just dropped:

$('#main_table').dragtable({
    persistState: function(data) {
       dropped_element = $(data.el).find("th")[data.endIndex - 1];
      // Do something with the element that was just dropped.
    }
});

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