Custom colReorder controller and turning off thead reorder

Custom colReorder controller and turning off thead reorder

kwiskokwisko Posts: 4Questions: 0Answers: 0
edited March 2014 in General
Hi,

I have a custom column reorder controller - UL element somewhere in the layout where I do drag'n'drop and using Datatables API send parmeters to plugin to do the reorder on the table.

My question is - can I somehow turn off default reorder effect on thead because my client don't want that, and now I have a problem and a missmatch with my custom controller if someone reorders columns using table header (my component isn't automatically updated because there is no automatic way - just manually)?

Thanks in advance.

Replies

  • kwiskokwisko Posts: 4Questions: 0Answers: 0
    I found a hack that works for me at this moment - removed event handlers in colReorder lib:

    [code]
    /* Add event handlers to the document */
    // $(document)
    // .on( 'mousemove.ColReorder', function (e) {
    // that._fnMouseMove.call( that, e );
    // } )
    // .on( 'mouseup.ColReorder', function (e) {
    // that._fnMouseUp.call( that, e );
    // } );
    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    That's an interesting point. There isn't the ability to disable the click for dragging the cells at the moment, although it is a good idea!

    Issue added here: https://github.com/DataTables/ColReorder/issues/15

    Until then, your hack will do nicely :-)

    Allan
This discussion has been closed.