Exact search match in 1.10
Exact search match in 1.10
lyndonwil
Posts: 40Questions: 5Answers: 0
I'm trying to search on a numerical column and i'd like to display and ID value of 1 rather than 21,31,41 etc...
I thought this may do the trick but it doesn't fire any records back ?
[code]
$('')
.prependTo( $(columnTh))
.on( 'change keyup', function () {
table.column( indexColumn )
.search( "^"+this.value+"$", true, false)
.draw();
})
[/code]
I'm guessing i've missed something very simple !
Lynd
I thought this may do the trick but it doesn't fire any records back ?
[code]
$('')
.prependTo( $(columnTh))
.on( 'change keyup', function () {
table.column( indexColumn )
.search( "^"+this.value+"$", true, false)
.draw();
})
[/code]
I'm guessing i've missed something very simple !
Lynd
This discussion has been closed.
Replies
Can you link me to a test case which doesn't please?
Allan
Sorry for the delay.. Here's a test case
http://cloud-contractor.co.uk/zTest2.php
Also, if you look at the link below, it uses a non exact search and works fine
http://cloud-contractor.co.uk/zTest1.php
Thanks
Lyndon
The filtering is being done at the server-side, so its not really a DataTables error.
Does your `tablepdo.php` script accept regular expressions? I suspect probably not, given the error. That script would need to be updated to provide exact matching abilities (easiest way is just to remove the `LIKE %%` stuff probably, although I don't know what is in that script).
Allan
Thanks for the scarily fast reply ;-)
i think my brain has stopped working. you're absolutely right..
the tablepdo.php is basically your server_processing.php
and i'd need to change the filtering within the equivalent of ssp.class.php ?
Lynd
Allan
just to be very awkward.. would you recommend any approach for having exact matching on one column and then normal matching on the others ?
Lynd
Allan
Thanks Allan,
I didn't explain my question very well.. What i wanted to do was send data from the table which i could intercept in the script and then conditional match accordingly..
I've got it working now using ajax data, fantastic.
Thanks again