简体   繁体   中英

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.

I removed the span and it started to work. I hope this helps somebody.

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"
}

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