Searching for sub-string from Cell value
Searching for sub-string from Cell value

Hello,
Using DataTables and set up columns like:
columns: [
...
{ data: "Location" }
],
Location data in a cell could be - "Los Angeles, New York, San Francisco"
In my javascript, I use
DataTable().getSelectedRow().data().Location.search("New York")
It works if search term is the first term but does not work in above scenario where New York is the second city listed.
When I assign the value of DataTable().getSelectedRow().data().Location to a variable, I see the complete string. So the search function seems to be an issue.
What can the solution be?
Thanks,
This question has an accepted answers - jump to answer
Answers
AFAIK
getSelectedRow()
is not a Datatables API. Are you using a third party plugin that provides thegetSelectedRow()
API?Typically
column().search()
is used to search columns with Datatables.Can you post a link to your page or a test case so we can take a look?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Are you trying to do something like this to get the index from the Javascript string search method?
http://live.datatables.net/yayamosi/1/edit
Kevin
Thanks again for your assistance Kevin