Mouse click search not in all columns
Mouse click search not in all columns
![John Dow](https://secure.gravatar.com/avatar/7f828c1d53a3821fcb131fc30c2d52e3/?default=https%3A%2F%2Fvanillicon.com%2F7f828c1d53a3821fcb131fc30c2d52e3_200.png&rating=g&size=120)
How can I exclude some columns from this function? Some of my columns are rendered in HTML links and the link is sent to the search bar
My column render:
{
data: 'telephoneNumber',
title: 'Телефон',
defaultContent: '',
className: 'my_cells',
render(data) {
return `<a href=tel:${data}>${data}</a>`
},
},
and this is transferred to the search string
<a href="tel:441059">441059</a>
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The example you linked to has this code:
Change the selector used to apply the click event to exclude the appropriate columns. Something like this:
Kevin
Kevin, I may have misunderstood you. Here are my settings, simply inserting column names does not produce any result. Data from ajax
The `` is a jQuery selector which does not know anything about the Datatables attributes like
columns.data
orcolumns.title
. You can use a class name or an index with:eq()
. See the jQuery selector docs for more optinos.Kevin
Kevin, thanks for the help and pointing out the path to finding a solution! As you can see, on the cells I need, I use the class = my_cells (centering the text vertically and horizontally) and based on this, with your help, I got the working solution I needed