Best practice: using column searching with FixedHeader/FixedColumns

Best practice: using column searching with FixedHeader/FixedColumns

yishayhyishayh Posts: 108Questions: 17Answers: 0
edited May 2016 in FixedHeader

Hi,

What is the best practice for using this:
https://www.datatables.net/examples/api/multi_filter.html
With this:
https://datatables.net/extensions/fixedheader/

The example was written to be used in a simple datatable, should we use something like the following:

 $('#XXX thead th').closest(".dataTables_scroll").find(".dataTables_scrollHeadInner table")

Or is there some better way of doing this?

Same question goes to FixedColumns.

I have additional related questions, but I'll ask them in other discussions and relate them back to this discussion.

Thanks,
Yishay

Answers

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin

    I would suggest having a second tr row in the table header and putting the filtering elements into one of the rows (so one controls sorting and the other does filtering).

    Allan

  • yishayhyishayh Posts: 108Questions: 17Answers: 0

    Hi Allan,

    That's what we did.
    I assume from your answer that using the code I mention is the best practice?
    Any clue as to what might cause the input to be disabled?

    Thanks,
    Yishay

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin

    The code appears valid. There are various ways of doing it - using table().header() is probably the best way to get the thead - although that won't always work in the case of FixedColumns since it splits the fixed elements off into its own table.

    Any clue as to what might cause the input to be disabled?

    No sorry. If it is disabled then something somewhere must be setting it as such.

    Allan

  • yishayhyishayh Posts: 108Questions: 17Answers: 0

    Hi Allan,

    thanks, I'll try to get some more information and than get back to you.

    Have a nice day,
    Yishay

This discussion has been closed.