How to do this .columns(1).search(Array)?

How to do this .columns(1).search(Array)?

choichoichoichoi Posts: 3Questions: 1Answers: 0
edited April 2020 in Free community support

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

Answers

  • choichoichoichoi Posts: 3Questions: 1Answers: 0

    i want to put data in sSearch_0 request forcibly!

  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    Answer ✓

    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

  • choichoichoichoi Posts: 3Questions: 1Answers: 0

    Thank you for answer.
    The solution was solved.

This discussion has been closed.