how to custom define the search field name
how to custom define the search field name
ihuangmx
Posts: 26Questions: 9Answers: 1
Hi, I got a problem, I defined a field 'good_id' like this
{
data: 'good_id',
searchable: false,
render: function(data, type, row, meta){
if(row.good){
return row.good.name;
}
return '';
}
},
but when I search , I want to search the field 'good.name' not 'good_id', so how should I do ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi ihuangmx,
Take a look at this example - here there's a different data source being used for the display and the filter.
For you, you could change the render on line 4 so that you do what you're currently doing for the display, then add a second function for the filter.
Hope that helps,
Cheers,
Colin