DataTables Column Searching
DataTables Column Searching
david.j.meyer2@boeing.com
Posts: 54Questions: 15Answers: 0
I am implementing column searching on a table that does server side processing. When i add the text to the column it is only performing "case sensitive" searches.
dataTable.columns(0).search("1N");
dataTable.draw()
That only matches the specific case.
This discussion has been closed.
Replies
Your server script is responsible for the search. You will need to look at your search query to determine why its case sensitive. Are you using one of the server side processing scripts supplied by Datatables?
Kevin
I'm implementing in C#, i have included the code below.
Looks like that code initializes the Editor. That is not the part of the code to look at. In your Datatables portion of the code you are performing some sort of data query from the Datatables Ajax requests. That is the code to look at.
Kevin
So My code is pretty simple for my table setup. I have created a custom button that reads input from the user in a textbox and applies it to the table. It works but it is case sensitive.
I'm getting frustrated, any help is appreciated.
thanks,
With
serverSide: true,
the search is performed by your server script. Your client code has not control over how the server script performs the search. When the search occurs Datatables is going to send an Ajax request to the URL you defined,url: "/api/archive",
. You will need to look at the server script called at/api/archive
to see what it is doing with the column searches.This explains the protocol used by server side processing:
https://datatables.net/manual/server-side
If you want to post your server script something may stand out. I'm not familiar with C# but others may be.
Kevin
Not sure what your data source is but it the DB might be setup as case sensitive. Or it could be your queries are performing case sensitive searches.
Kevin
The code i posted first instantiating the editor is all that is being done on the ajax call.
We are working with an oracle database with a table that has 350K rows. Not sure what I'm missing. Your first reply implied that I shouldn't be using the editor, is there a "DataTable" object i should be using instead?
Again I'm not familiar with C# so I may not understand the
var response = new Editor(db....
code you posted. The point is that you have server script that handles the Ajax requests from Datatables to support the parameters sent by the server side processing mode.Anyway, you said you have Oracle. That is also something I'm not familiar with but I found this SO Thread that states "string comparisons are case-sensitive". Maybe this is the problem you are seeing.
Datatables doesn't control whether the server performs case sensitive or insensitive searches. @allan or @colin may have some ideas for you but it sounds like you either need to find a way to make your Oracle query statements use case insensitive searches (maybe convert the search term and field value in the SELECT to upper case, like this) or change settings of your DB to default to case insensitive searches.
Kevin
It looks like you need to use NLS_COMP to do a case insensitive sort in Oracle (or use regex).
So you could try:
before you initialise the Editor instance in C#.
Allan