Filter column with Date Range and fnDrawCallback oSettings doesn't provide data for date filter

Filter column with Date Range and fnDrawCallback oSettings doesn't provide data for date filter

vishrutvishrut Posts: 3Questions: 1Answers: 0

Hi,

I am trying to get the filter column data on fnDrawCallback function in DataTable. I am albe to receive the values for text type filter columns using oSettings.aoPreSearchCols array but it doesn't provide values for date range type of filter.

Could you guys please help me?

Thanks in advance.

Replies

  • vishrutvishrut Posts: 3Questions: 1Answers: 0
    edited July 2014

    Below is the example of the code snippet, I am using

      $('#table_id').dataTable({
        "sDom": 'lrtip',
        bProcessing: true,
        bServerSide: true,
        sAjaxSource: $('#table_id').data('source'),
        "bAutoWidth": false,
        "bDeferRender": true,   
        "aoColumns": [
          { "sWidth": "50%" },
          { "sWidth": "50%" },     
        ],  
        "fnDrawCallback": function(oSettings){
          console.log(oSettings.aoPreSearchCols[0].sSearch);
          console.log(oSettings.aoPreSearchCols[1].sSearch);
        }
      })
      .columnFilter({
          sPlaceHolder: "head:after",
          aoColumns: [      
            {type: "text"},
            {type: "date-range"}       
          ]
        })
    

    It doesn't give value for sSearch of date-range filter. It return empty string.

This discussion has been closed.