How to Filter excluding certain columns or filter only on text content (not html tags) within cells

How to Filter excluding certain columns or filter only on text content (not html tags) within cells

linenoise88linenoise88 Posts: 2Questions: 0Answers: 0
edited October 2009 in General
This table plugin has great features and has the look that is exactly what I want for my website. The trouble I'm having is that there are some links and images embedded in table cells that the filter is including within its search.
For example, I have a link to open a user edit screen when an icon is clicked on.

Sample HTML:
user_first_name
user_last_name

Edit User
User Access Levels


So when a user users filters that happen to be attribute values (i.e. class, edit, user, href, info ) all of the items are listed which is obviously not what the user wants.

How can I either:
1. Ignore html attribute values from the filter search?
2. Remove only a specified column from the filter search?

Replies

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Hi linenoise88,

    1. You need to set the sType for the column to 'html'. See this example: http://datatables.net/examples/advanced_init/html_sort.html

    2. You can specify if a column should not be included in the filtering using the bSearchable parameter: http://datatables.net/usage/columns#bSearchable

    Hope that helps!
    Allan
  • linenoise88linenoise88 Posts: 2Questions: 0Answers: 0
    Thanks Allen, this is exactly what I was looking for.
  • greenflashgreenflash Posts: 58Questions: 5Answers: 0
    How would I use the HTML for sorting (for example by using a title in an empty span) but exclude the HTML from the search?

    Campbell
This discussion has been closed.