Get raw data inside a cell
Get raw data inside a cell

Simple question: on clicking the Check marks on several rows, I get the rows data via:
myIds = dt.rows({selected: true}).data();
However, in my HTML one column contains text WRAPPED inside a component like this:
<td>
<INDICATOR class= "ok_status>
OK status
</INDICATOR>
When I get the data, the content for that column is the complete HTML: <INDICATOR class="ok_status">OK status</INDICATOR>, but I need to get only the text inside: OK_status
How can I possibly do that?
The reason of needeing just the text is that I'm creating a javascript object with key/values where the value is the content (no need of the wrapping html tags)
Replies
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I would loop through the rows using
rows().every()
then use jQuery to get the text of the<INDICATOR>
. Something like this:http://live.datatables.net/rociquji/1/edit
You will still need the
{selected: true}
- I was too lazy to setup the select partKevin