Is there a way to disable the default warnings?
Is there a way to disable the default warnings?
I have modified the ssp.class.php (and changed it's name to FilterSort.class.php). I added the ability to have multiple search values in a single search box using the Individual Column Searching Text Input. I made it so that you can separate your search values with a ; and it'll search for each of those values. When I do this for a date as I'm typing in the date I get a warning that the SQL is not working. I get this popup from DataTables:
DataTables warning: table id=DataTableEdit - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
and this in the Preview on the developer tab in Firefox:
{"error":"A SQL error has occurred: SQLSTATE[22007]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Conversion failed when converting date and\/or time from character string. 1 1 1"}
When I finish typing out the date, however, I don't get the errors it just does the search.
Is there a way to keep the errors from popping up while I'm still typing in the date? or delay the search till I'm done typing so that I don't get the error?
This question has an accepted answers - jump to answer
Answers
Possibly your best option is to change the column filtering code that you are using to listen for a return key and only at that point execute the
column().search()
method.e.keyCode == 13
should do it (wheree
is the event).Allan
@allan
Here is how I am currently initializing my DataTables:
So you are saying that I should change the
$('input', this.footer()).on('keyup change', function() to
$('input', this.footer()).on('keyup change', function(e)
and add after that something like
if (that.search() !== this.value & e.keyCode == 13)?
Basically yes
This did work. The search now waits for the user to hit Enter.