How to ignore html elements in anchor tag
How to ignore html elements in anchor tag
In the following column, I would like the filter search to only consider "Louisville" and to ignore "Kentucky" (Which is only "visible" to the user when the popover link is clicked.) My problem is that if I filter for "Ken" (as in Kenny), the following row will still show even though the only "data" I want considered is "Louisville":
<td>
<a href="#"
data-toggle="popover"
data-html="true"
title="<b>State:</b>"
data-content="<b>Kentucky<b>">Louisville
</a>
</td>
Answers
This example from this thread should get you going!
Colin
I've tried this without success. Is there additional information you may need to provide further assistance?
You will need to take the example that Colin posted and work with it a bit to extract the data you want. Something like this:
http://live.datatables.net/wehejaba/1/edit
I created a cell with the above
td
you provided. Its not the most elegant solution and may not always work with your data. You may be able to workout a regex expression to pull just the data you want. Use console.log statements or the browser's debugger inside thecolumns.render
function to debug what is happening with the regex, etc.Also you will want to read up on orthogonal data. My example extracts
Louisville
for all operations exceptdisplay
.Kevin
... and if none of that helps, please update my test case to demonstrate your problem,
Colin
Hi Colin,
I updated the example to illustrate my problem. If you filter on "Ken" the line containing "John Bassert" should not show up. But it does because the data-content element contains the word "Kentucky"
Actually, your example is working as I would expect. I will examine it a little closer. Thanks.