简体   繁体   中英

BFilter not removing the search filter from datatable

I have a htm page somewhat like this.

<div class="row-fluid">    
    <div class="span12">    
        $NewReport$    
    </div>
</div>

Where NewReport is a grid thats populated using a datatable.

view.Replace("$NewReport$", grid.Render("NewReport", model.NewReportDataTable, GetNewReportGridColumns(model)))

On rendering it appears with the search filter which I don't want. I know that bFilter property could be set to False to turn the search filter off. But I am not sure where to use it. Can someone please help me with this?

This could help you to solve issue. There might be version issue for datatable.

If DataTables >= 1.10 use:

$('table').dataTable({searching: false, paging: false, info: false});

If DataTables < 1.10 use:

$('table').dataTable({bFilter: false, bInfo: false});

you can also check pure CSS solution:

.dataTables_filter, .dataTables_info { display: none; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM