Search code examples
datatablesyadcf

yadcf range_date does not filter anything


I am using the latest version to filter a date range. My data rows look like this:

<td>
<span>{{item.actionDTS | date: 'MM/dd/yyyy' }}</span>
</td>

The filter "from" and "to" works fine, but when I select the date it does not filter anything. My filter column is setup like this:

$("#tbl_Report").dataTable().yadcf([
                    {column_number: 0, filter_type: 'text'},
                    {
                        column_number: 1,
                        filter_type: 'range_date',
                        date_format: 'mm/dd/yyyy',
                        filter_container_id: "external_filter_container"
                    },
                  ....
                ]);

Any help is appreciated.


Solution

  • Since you are holding your data wrapped inside html element you should use column_data_type in your yadcf setup so it looks like this:

    {
        column_number: 1,
        filter_type: 'range_date',
        date_format: 'mm/dd/yyyy',
        column_data_type: html,
        filter_container_id: "external_filter_container"
    }