Column-reorder event never has property 'drop' set to true

Column-reorder event never has property 'drop' set to true

chiloutuschiloutus Posts: 10Questions: 4Answers: 0

Hi,

I'm having an issue where I want to be able to key into when a column is placed on the table rather than when the user is just moving columns around the table. From reading the documentation it seems like I need to check if details.drop from the events paramaters is true at that point, but it seems like this column-reorder event is not fired when the user drops the column. Am I missing something here?

Test case attached: http://jsfiddle.net/w49ru5no/

Thanks for the great work on this plugin :)

This question has an accepted answers - jump to answer

Answers

  • chiloutuschiloutus Posts: 10Questions: 4Answers: 0
    edited January 2016

    So after some investigation it seems like this line in
    datatables.colreorder.js 146

    /* Sanity check in the input */
    if ( iFrom == iTo )
    {
        /* Pointless reorder */
        return;
    }
    

    catches the drop event and returns before propogating the event further. Should this attempt to propogate the event further if it is a drop event? Maybe something like

    /* Sanity check in the input */
    if ( iFrom == iTo && !drop)
    {
        /* Pointless reorder */
        return;
    }
    
  • gabodawngabodawn Posts: 3Questions: 1Answers: 1
    edited January 2016 Answer ✓

    (Assuming you are using colReorder extension)
    this happened to me a week ago, it was driving me insane.
    finally i found out that detais.drop is incompatible with realtime.
    once i set colReorder with realtime: false this property is set to true.

    More description of my problem in the discussion that i created.
    https://www.datatables.net/forums/discussion/32705/what-do-i-have-to-do-to-make-details-drop-equals-true-in-colreorder-plugin#latest

    Hope this can help you.

  • chiloutuschiloutus Posts: 10Questions: 4Answers: 0

    Hey gabodawn, thanks for your response. I did come across that but I thought (incorrectly) it would be unrelated. I'll check that out, thanks!

This discussion has been closed.