Skip to content

Add a parameter value to the fnReorderCallback #30

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

Closed
wants to merge 1 commit into from

Conversation

benoitmarineau
Copy link

the fnReorderCallback was called without returning any values. it now returns an object with some basic info

the fnReorderCallback was called with returning any values. it now returns an object with some basic info
@DataTables
Copy link
Collaborator

Hi,

Thanks for this! I don't see any problem with it, but I've been thinking about how best to improve the ColReorder interface. As such, I'm not going to pull this in immediately, but rather wait until I've had a little more time to think about how to move ColReorder forwards.

Despite my hesitation (which is of my own making), I really like the look of this. Can you confirm that you would be happy for this to be released under the current MIT license if I do pull it in please?

@benoitmarineau
Copy link
Author

Feel free to use it and enhance it the way you want it :)
As long as it have some sort of reference to the current table and also the colReorder indexes (from and to)

@bakerac4
Copy link

bakerac4 commented Apr 2, 2015

+1 for this. Are there any known work arounds right now where I could get what item actually moved?

@DataTables
Copy link
Collaborator

Yes, listen for the column-reorder event.

From the code:

$(oSettings.oInstance).trigger( 'column-reorder', [ oSettings, {
    "iFrom": iFrom,
    "iTo": iTo,
    "aiInvertMapping": aiInvertMapping
} ] );

@DataTables
Copy link
Collaborator

Finally been looking into this (sorry for the massive time delay) - the issue with passing back swapped information in the callback is that there might actually have been multiple columns changed, not just one. I think the column-reorder.dt event is probably the preferred option to know when column ordering is changed at the moment.

@DataTables DataTables closed this Feb 9, 2016
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

Successfully merging this pull request may close these issues.

3 participants