How to do this .columns(1).search(Array)?
How to do this .columns(1).search(Array)?
choichoi
Posts: 3Questions: 1Answers: 0
Hi, I want to know how to send an array to the search function.
I send data to the servser side.
Please understand that English is immature because I am Korean.
This is code. Some were omitted.
myTable = $("#dataTable").DataTable({
buttons: [
{
text: 'lookUp',
action: function (e, dt, node, config) {
var transactionResultTypeArt = $("input[name=transactionResultType]:checked").map(function() {
return $(this).val();
}).get();
const table = $('#dataTable').DataTable();
const userData = {
transactionResultTypeArt: transactionResultTypeArt,
};
table
.columns(0).search(userData.transactionResultTypeArt)
.draw();
}
}
],
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
i want to put data in sSearch_0 request forcibly!
You can't search with an array, but you can give it values like
(value1|value2)
. For example, on this page here, you can enter(Ashton|Airi)
into "Column - Name" and tick the "treat as regex" checkbox. That may give you what you want.Colin
Thank you for answer.
The solution was solved.