Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82379

Null values cannot be filtered

$
0
0
  •     this.api().columns([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]).every( function () {             
                    var column = this;
                    var select = $('<select style="border:1px solid #ced4da;height:30px"><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 ) {
                     if(column.search() === '^'+d+'$'){
            select.append( '<option value="'+d+'" selected="selected">'+d+'</option>' )
        } else {
            select.append( '<option value="'+d+'">'+d+'</option>' )
        }
                    } );
                } );
            },**: 
    

There are null values and null values in my data. Other values can be filtered by drop-down, but null values and null values cannot be filtered. Is there a problem with my local code? Please help correct it.


Viewing all articles
Browse latest Browse all 82379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>