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

Datatable Filter listbox contain [object Object] when data: null is used for column

$
0
0
            columns: [ 
                {data: 'operations.Libelle' },
                {data: 'lots.Numero' },
                {
                    data: null,
                    render: function ( data, type, row ) {
                        return ((data.PresCiv.Libelle)?data.PresCiv.Libelle+' ':'')+data.prescripteurs.Nom+' '+data.prescripteurs.Prenom;
                    }
                },
                {
                    data: null,
                    render: function ( data, type, row ) {
                        return ((data.ProsCiv.Libelle) ? data.ProsCiv.Libelle+' ':'')+data.options.Nom+' '+data.options.Prenom;
                    }
                    ,editField: ['options.Nom', 'options.Prenom']
                },
                {data: 'options.Date'}
            ],
            
            order: [[ 6, 'desc' ], [ 5, 'desc' ]],
            columnDefs: [{target: [4,5,6,7]}],
....
            initComplete: 
                function () {   
                    if (savedSelected) {
                        this.api().rows(savedSelected).select();
                        this.api().state.save();
                    }               
                    
                    this.api().columns([0,1,2,3]).every( function () {// afficher les listbox de filtrage pour les colonnes concernées
                        var column = this;
                        var select = $('<select><option value=""></option></select>')
                            .appendTo( $(column.footer()).empty() )
                            column.data().unique().sort().each( function ( d, j ) {
                                var t = '<option ';
                                if ( (d) ){
                                    if  (savedColumnsFilters){
                                        if (savedColumnsFilters[column[0][0]].search.search == '^'+d+'$'){
                                            t += "selected='selected' ";
                                        }
                                    }
                                    select.append( t + 'value="'+d+'">'+d+'</option>' );
                                }
                            });
                    });
                }



Viewing all articles
Browse latest Browse all 81728

Trending Articles



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