How to ignore html elements in anchor tag

How to ignore html elements in anchor tag

TimTTimT Posts: 4Questions: 1Answers: 0

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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This example from this thread should get you going!

    Colin

  • TimTTimT Posts: 4Questions: 1Answers: 0

    I've tried this without success. Is there additional information you may need to provide further assistance?

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    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 the columns.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 except display.

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    ... and if none of that helps, please update my test case to demonstrate your problem,

    Colin

  • TimTTimT Posts: 4Questions: 1Answers: 0

    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"

  • TimTTimT Posts: 4Questions: 1Answers: 0

    Actually, your example is working as I would expect. I will examine it a little closer. Thanks.

This discussion has been closed.