Search filter select not working for array

Search filter select not working for array

kingsluciferkingslucifer Posts: 1Questions: 1Answers: 0

Hi,

First of all, thanks for your help in advance and datatable is great.

I have question about the following code:
if (idx === 3) {
dt.column(3, { search: 'applied' })
.data(toString)
.unique()
.sort()
.each(function (d, j) {
{
if (renderFunction == null) {
select.append('<option value="' + d + '">' + d + '</option>');
} else {
select
.append('<option value="' +
d +
'">' +
renderFunction(d, 'display', null) +
'</option>');
}
}
});
}

The issue is the column.data is actually a list of string from view model. In this case, it is an array, and from other posts I know unique does not work for arrays. I tried to use tostring to convert the data before calling unique, but it's not working. I can't really figure this out. Could anyone help on that?

Thanks!

This discussion has been closed.