I have an alphanumeric column with strings like "1, 2, 2". When I type "1, 2, 2" in the search, it seems to be returning all cells with "1," and "2,". What can I do so the search returns only "1, 2, 2"?
Using Datatables 1.9
Turn smart filtering off, bRegex as true treats search string as regular expression:
"oSearch": { "bSmart": false, "bRegex": true }
Sorry, I am not allowed to comment on the previous answer.
In the documetation Options (legacy documentation for DataTables v1.9) says: "As an object the "sSearch" parameter must be defined, but all other parameters are optional."
If you do not define it, you can eventually get the error "a.oPreviousSearch.sSearch is undefined".
Then add sSearch to bSmart and bRegex parameters:
"oSearch": {
"bSmart": false,
"bRegex": true,
"sSearch": ""
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With