Individual column searching (select inputs)-not working weblink data in tables

Individual column searching (select inputs)-not working weblink data in tables

n1x0nn1x0n Posts: 4Questions: 1Answers: 0

I use datatable , and it generates the json , 4 column (product , category , manufacturer, price )
Data Type column in the "category name" is a type of web link as <a href="/category_weblink.html">simple Category</a>
Default version of the table looking for and executes all commands excellent, but it took me to make select sorting by category and here there was a problem . Data from the plain text(product,price,manufacter) format sorts the selectivity is good, but the column data type - web links does not filter!!! , Answer no data to display 0

1.png 27.2K
2.png 22.3K
3.png 106.6K

Answers

  • n1x0nn1x0n Posts: 4Questions: 1Answers: 0
    edited July 2016

    im using

    >! <script>
    >! $(document).ready(function() {
    >!     $('#example').DataTable( {
    >!         initComplete: function () {
    >!             this.api().columns().every( function () {
    >!                 var column = this;
    >!                 var select = $('<select><option value=""></option></select>')
    >!                     .appendTo( $(column.footer()).empty() )
    >!                     .on( 'change', function () {
    >!                         var val = $.fn.dataTable.util.escapeRegex(
    >!                             $(this).val()
    >!                         );
    >!  
    >!                         column
    >!                             .search( val ? '^'+val+'$' : '', true, false )
    >!                             .draw();
    >!                     } );
    >!  
    >!                 column.data().unique().sort().each( function ( d, j ) {
    >!                     select.append( '<option value="'+d+'">'+d+'</option>' )
    >!                 } );
    >!             } );
    >!         }
    >!     } );
    >! } );
    >! </script>
    
  • n1x0nn1x0n Posts: 4Questions: 1Answers: 0

    thank you, take care, topic closed

This discussion has been closed.