Search a value with parenthesis in Datatable search not giving the result

Search a value with parenthesis in Datatable search not giving the result

subhajitsubhajit Posts: 1Questions: 1Answers: 0
edited November 2019 in Free community support

I have the following code which is used to create the datatble and filter the value, but when the value contains parenthesis then the search is not giving any result though value can be seen if I chose to see All.

initComplete: function () {
                         this.api().columns([1,2,3,4,5,6]).every(function () {
                         var column = this;
                         var select = $('<select style="width:130px; font-size: 13px;text-align-last: center; padding: 2px 1px 2px 1px; background: #fff; border: 1px solid #ccc; border-radius: 6px;position: relative; "><option value="">(All)</option></select>')
                        .appendTo($(column.footer()))
                          .appendTo( $(column.footer()).empty() )
                                 .on('change', function () {
                                     var val = $.fn.dataTable.util.escapeRegex(
                                         $(this).val()
                                     );
                                    alert("Asche::"+val);
                                     column
                                         .search(val ? '^' + val + '$' : '', true, false)
                                         .draw();
                                 });
                             column.data().unique().sort().each(function (d, j) {
                                 select.append('<option style="text-align-last: right;" value="' + d + '">' + d + '</option>')
                    } );
                } );
            }

Edited by Kevin:  Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

Answers

This discussion has been closed.