Array value on a row

Array value on a row

vektormediavektormedia Posts: 2Questions: 1Answers: 0

Hi,

I'm new in datatables :-)

How to i get the values from a row in a dropdown filter if the row has the value as an array a,b,c...

Answers

  • vektormediavektormedia Posts: 2Questions: 1Answers: 0

    Right now i get the value like this

        this.api().columns(2).every( function () {
            var column = this;
            var select = jQuery('<select><option value=""></option></select>')
                .appendTo( jQuery('#filters-by-category') )
                .on('change', function () {
                    var val = jQuery.fn.dataTable.util.escapeRegex(
                        jQuery(this).val()
                    );
                     column
                        .search(val ? '^' + val + '$' : '', true, false)
                        .draw();
                });
    
            column.data().unique().sort().each(function (d, j) {
                select.append('<option value="' + d + '">' + d + '</option>');
            });
        });
    
This discussion has been closed.