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

Load initial table with filter applied

$
0
0

Hello,

Thanks for taking time to read my post. My first time using the extension and I'm stuck. I want the datatable to load with a filter/search applied. I've searched and tried many of the implementations but I always receive a full data set. I'm able to apply filters with "onclick" events but not able to set a default.

<

script type="text/javascript">

window.onload = function defer()
  {
    if(window.$)
    {
        var table = $('#tbl').DataTable({
            //"aoSearchCols": [{ "sSearch": "^[0-9]", "bEscapeRegex": false }],
            "retrieve": true,
            "paging": false,
            "ordering": false,
            "info": false,
            "search": false,
            "fnInitComplete": function (oSettings, json) {
                alert('DataTables has finished its initialisation.')
            }
        });
    }
    else
    {
        setTimeout(defer(), 50);
    }
}
function fil(rexp)
{
    var table = $('#tbl').DataTable({

"retrieve": true, "paging": false, "ordering": false, "info": false, "search": false }); table .columns(0) .search(rexp, true,false,true) .draw()

}

Viewing all articles
Browse latest Browse all 82388

Trending Articles



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