ColReorder in Multi-row Head

ColReorder in Multi-row Head

fruedadevfruedadev Posts: 5Questions: 2Answers: 0
edited January 10 in Free community support

Hello,

I have the table you can see in this test case, a table with 2 rows in the header, one of them for filtering each column. The problem I have is that I am able to reorder the columns, clicking on any of these rows. But that:

  1. Is not desirable.
  2. Even if it would (I think we could live with that), if you click into the filter textbox, it selects the table's content while moving the mouse to reorder the column.

Is there any option in ColReorder to specify the exact row to be clicked? Or programmatically, if there's no option for that?

Thanks in advance.

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Good idea! There was no option for that in ColReorder, so I've gone ahead and added a new colReorder.headerRows option which is an array of the row indexes in the header to receive the click and drag listener. This is the commit.

    It will be in the nightly build shortly :).

    Allan

  • fruedadevfruedadev Posts: 5Questions: 2Answers: 0
    edited January 10

    I've so far workarounded it using the following code after the datatable initialization:

        $('#datatable thead tr:nth-child(2) th').off('mousedown');
    

    It works, and it's simple, but I'm wondering if there's another way to do it.

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    That looks good. The alternative is to use the change I committed earlier today.

    Allan

Sign In or Register to comment.