selecting rows based on column value
selecting rows based on column value

I'm trying to select all the rows based on a column value. How would I go about doing this? I've tried
table.rows({search: 'value'}).data().toArray()
and a couple of other things I don't remember at this point. I know this isn't as hard as I'm making it
This discussion has been closed.
Answers
By "select" do you mean highlight (select) the rows in the table or get the data?
Your code snippet suggests you are trying to get the data. The
filter()
API can be used for this.Kevin
I'm trying to get the data. This is what I have now
table.columns(4).search('Hpg').draw();
data = table.rows({search: 'applied'}).data().toArray()
but I'm getting rows is not defined in console
I'm an idiot.. this works
table.columns(4).search('Hpg').draw();
data = table.rows({filter: 'applied'}).data().toArray()
I gave you only a partial answer. Here is an example that uses filter to get the row data:
http://live.datatables.net/zesacofe/1/edit
This way you don't need to search and update the table display to get the rows you want.
Kevin