"searchCols" does not work for me:

"searchCols" does not work for me:

nelsonvelazqueznelsonvelazquez Posts: 5Questions: 3Answers: 0
edited July 2023 in Free community support

Hello, thanks in advance for helping me. I used the code that you sent me, but I can't get it to work. I send the code that I use according to the interpreter. Please help me.

the table has 7 columns and i want to filter or search by initializing on column 0

<script> 
jQuery(document).ready(function() { 
   var table = $('.example-table').DataTable( {
       dom: '<"top"i>rt<"bottom"flp><"clear">',
       language: {
     
        },
        order: [[6, 'Dasc']],
            "paging":   false,
            "info": false,
  "searchCols": [
    null,
    { "search": "101" },
    null,
    { "search": [0], "regex": true }
    { "search": [1], "regex": false }
    { "search": [2], "regex": false }
    { "search": [3], "regex": false }
    { "search": [4], "regex": false }
    { "search": [5], "regex": false }
    { "search": [6], "regex": false }
    
  ]

} );

    } );
 
</script>

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

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.