更改日期范围过滤器类型属性

时间:2018-01-12 17:34:57

标签: yadcf

我在我的项目中使用以下代码作为范围日期

var datepickerDefaults = {
    showTodayButton: true,
    showClear: true
};


yadcf.init($Table, [{
      column_number: 0,
      filter_type: "range_date",
      datepicker_type: 'bootstrap-datetimepicker',
      date_format: 'DD/MM/YYYY',
      filter_plugin_options: datepickerDefaults,
      filter_container_id: "FilterContainer_Date",

  } ],
    {
        cumulative_filtering: true
    }
);

我想将日期范围过滤器更改为输入占位符文本,我想为和<分配默认值strong> to 输入。

1 个答案:

答案 0 :(得分:2)

行。我找到了解决方案如下;

yadcf.init($Table, [{
        column_number: 0,
        filter_type: "range_date",
        datepicker_type: 'bootstrap-datetimepicker',
        date_format: 'DD/MM/YYYY',
        filter_plugin_options: datepickerDefaults,
        filter_container_id: "FilterContainer_Date",
        filter_default_label: ["From Date", "End Date"]

    }],
    {
        cumulative_filtering: true
    }
);

yadcf.exFilterColumn($Table, [
    [0, {
        from: '01/12/2017',
        to: '31/01/2018'
    }],
]);