Iulian Onofrei
Iulian Onofrei

Reputation: 9740

DataTables filter alias

I'm using DataTables plugin and I would want to be able to set an alias for some cells for easy searching.

For example, I would like to be able to find "Mr. John" if I search for "Mister John".

I think I saw somewhere in the documentation about this, but I can't find it again at all.

Upvotes: 2

Views: 883

Answers (1)

TPete
TPete

Reputation: 2069

DataTables Orthogonal Data feature is what you are looking for. Your example might look like this:

<tr>
    <td data-search="Mister John">Mr. John</td>
</tr>

Using html5 data attributes, you can specify additional data which DataTables will process when searching. No further configuration is needed.

Upvotes: 1

Related Questions