fnSetFilteringDelay plugin

fnSetFilteringDelay plugin

Alex2019Alex2019 Posts: 62Questions: 9Answers: 0

Hello,
how does this plugin work?
I tried to insert it in the code but the filters don't work

<script type="text/javascript" src="fnSetFilteringDelay.js"></script>
<script>
$(document).ready(function(){
    
    'use strict'; // start DOM
    
 oTable = $('#example').dataTable().fnSetFilteringDelay(1000)(
  
  {
        "retrieve": true,
        "paging":   true,  // Table pagination
        "order": [[ 1, "asc" ]],  // Column ordering 
        "info":     true,  // Bottom left status text

        "bAutoWidth":     true,  // Bottom left status text
        "bJQueryUI": true,
        "searchDelay": 900000,
        "sDom": '<"H"lfir>t<"F"ip>' ,// info bottom and above
        "aoColumnDefs": [{ "bSearchable": true, "bVisible": false, "aTargets": [ 10 ] },] // hide column but filter enable
        
        
  }// end DOM
  // start column
  ).yadcf([
        {column_number : 1, column_data_type: "html", html_data_type: "text", filter_default_label: "Select Actor"},
        {column_number : 2, filter_type: "auto_complete", text_data_delimiter: "-", filter_default_label: "select Year"},
        {column_number : 3, filter_type: "range_number", data: ["0", "100"],filter_delay: "500", filter_container_id: "external_filter_container1"},
        {column_number : 4, data: ["Active", "Retired" , "Dead"],  filter_default_label: "Select Status"},
        {column_number : 5, html_data_type: "text",text_data_delimiter: ",", filter_match_mode : "exact", filter_container_id: "external_filter_container3"},
        {column_number : 6, column_data_type: "html", text_data_delimiter: " ", filter_default_label: "Select start"},
        {column_number : 7, column_data_type: "html", html_data_type: "text", filter_container_id: "external_filter_container5", filter_default_label: "select"},
        {column_number : 8, column_data_type: "html", text_data_delimiter: ",", filter_default_label: "select", filter_container_id: "external_filter_container2"},
        {column_number : 9, data: ["Yes", "No"],  filter_default_label: "Select Yes/No" , filter_container_id: "external_filter_container4"}
        
        ]);
        SyntaxHighlighter.all();
});

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923
    edited December 2020 Answer ✓

    how does this plugin work?

    The plugin can be found here:
    https://datatables.net/plug-ins/api/fnSetFilteringDelay

    The docs state this:

    Please note that this plug-in has been deprecated and the dt-init searchDelay option in DataTables 1.10 should now be used. This plug-in will not operate with v1.10+.

    The searchDelay docs state this:

    The built-in DataTables global search (by default at the top right of every DataTable) will instantly search the table on every keypress when in client-side processing mode and reduce the search call frequency automatically to 400mS when in server-side processing mode. This call frequency (throttling) can be controlled using the searchDelay parameter for both client-side and server-side processing.

    This only affects the default global search input.

    I tried to insert it in the code but the filters don't work

    What isn't working?

    Since you are using client side processing the above is likely not going to help. They especially won't affect the YADCF searches. If the problem is with YADCF you should contact the developer on the github site.

    for us to help you will need to post a link to your page or a test case replicating the issue so we can help debug. Also provide details of the problem and how to reproduce it.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • Alex2019Alex2019 Posts: 62Questions: 9Answers: 0

    hi kthorngren,
    solved after update version DataTables 1.10
    Thank you

This discussion has been closed.