Unable to do column().search() on render/filter data
Unable to do column().search() on render/filter data
garuda_one
Posts: 9Questions: 0Answers: 0
I have individual column searching (in addition to the global search), and the column searches aren't hitting my filter
data.
Initialization of one of these columns:
{
data: "Date", name: "date", render: function (data, type, row) {
if (type === 'display' || type === 'filter') {
return new Date(data).toLocaleDateString();
}
return data;
}
}
and the column search setup:
$("#my-table .filter-row input").each(function(i) {
$(this).on('keyup change', function() {
table.columns(i).search($(this).val()).draw();
});
});
Screenshots (imgur):
Global search success
Column search fail
Does column().search()
not use the filter
data source? Or am I (more likely) overlooking something?
This discussion has been closed.
Replies
To add some more info - the date
data
comes as something like2018-05-22T13:11:51.627
, and doing a column search on2018-05
also yields no results...OK, really should have prepared for this post better. Now that I'm paying attention, that column curiously only ever returns one hit, and it's the same row every time. If I type
0
into that column search, it will return a row whose Date field is2/28/2018
. That same result also comes up if I type2
,20
, or201
, but the search returns nothing on2018
. Now I KNOW I'm overlooking something...Not sure how to edit my post, but I've updated the column search to not use smart search (this hasn't changed any of my problems, though)
Yup.......................................................................................................................................................................................................................................................................................................................................................my column operations are off because I have hidden columns. So everything is working as intended................