Column Search and table header customization
Column Search and table header customization
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
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.
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 theinput
. Looking at the applied event listeners it looks like sorting also useskeypress
. 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.
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
@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.