Disable SearchBuilder for Column
Disable SearchBuilder for Column
washuit-iamm
Posts: 133Questions: 55Answers: 2
{
title: "Product Tags",
data: "Product",
render: function (products) {
return products.reduce(function (acc, cur) {
return acc + `<span class="badge text-bg-light mx-1">${cur.Name}</span>`;
}, "");
},
visible: true,
sortable: false,
searchable: false, // This does not disable searchBuilder!!!
},
Looking for something like searchBuilderEnabled: false
This question has accepted answers - jump to:
Answers
See if
searchBuilder.columns
does what you want.Kevin
@kthorngren
That is a white-list and not a black-list right?
I have over 100 columns, that would be very ugly for me to have to remember yet another place to list my columns.
If it automatically opts-in to my columns, why cant I opt-out?
@kthorngren
Went with this route, don't love it but its terse enough...
The
searchBuilder.columns
states this:You could assign a
className
to the columns you want to opt-out of SearchBuilder then use the jQuery :not() selector. For example:https://live.datatables.net/fabaxeni/1/edit
Kevin