Column Search and table header customization

Column Search and table header customization

montanhesmontanhes Posts: 2Questions: 1Answers: 0

Link to test case: I don't have one yet
Debugger code (debug.datatables.net): no debug code
Error messages shown: no error
Description of problem: It's not a problem but I found this approach https://datatables.net/extensions/fixedheader/examples/options/columnFiltering.html and I have a few questions about it.

1) Using this columns search (Filter?) it will make a request and build the table with the response?
2) I'm able to remove the title header or replace it with just the columns search?
3) If the last question is possible can also I have ordering on the same columns search?
4) I'm able to have some columns with <select> instead of input search?

Below I have added an image of what I want to do with the datatables:

https://i.imgur.com/dOG5qRj.png

A simple header with search/select and ordering.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,324Questions: 26Answers: 4,949
    Answer ✓

    Using this columns search (Filter?) it will make a request and build the table with the response?

    The column search filters the data contained in the table. If you are using server side processing the search request is sent to the server.

    I'm able to remove the title header or replace it with just the columns search?
    If the last question is possible can also I have ordering on the same columns search?

    There is nothing built into Datatables to isolate the click event in the input from the sort click event listeners. However you could possibly use jQuery event.stopPropagation() in a click event for the input. Looking at the applied event listeners it looks like sorting also uses keypress. Here is an updated example of the link you posted:
    http://live.datatables.net/wuguboki/1/edit

    There may be other events listeners you will need to handle.

    I'm able to have some columns with <select> instead of input search?

    You can mix and match. One way is to use classnames to differentiate between text inputs and select. See this example of select inputs. The column-selector can be a classname. You would specify the classname in line 16 of the example you linked and line 4 of the select example.

    Kevin

  • montanhesmontanhes Posts: 2Questions: 1Answers: 0

    @kthorngren great. I will try to mix everything to accomplish what I need. Thank you so much to take time and answer all I have asked.

Sign In or Register to comment.