使用yadcf从多选列中获取选定的过滤器

时间:2017-04-27 15:56:56

标签: yadcf

您好我正在使用带有数据表的yadcf,它允许我进行多选列过滤,这让我很开心。现在,我想将过滤器中的选定值作为标记显示在单独的搜索栏中。如何在多选列过滤器中获取所选值?感谢。

1 个答案:

答案 0 :(得分:0)

您应该使用exGetColumnFilterVal方法,如下所示:

yadcf.exGetColumnFilterVal(oTable,1);

参见相关文档(来自yadcf js文件)

* exGetColumnFilterVal
                Description:        Allows to retrieve  column current filtered value (support ALL filter types!!!)
                Arguments:          table_arg: (variable of the datatable),
                                    column number:  column number from which we want the value
                Usage example:      yadcf.exGetColumnFilterVal(oTable,1);
                Return value:       String (for simple filter) / Object (for range filter) with from and to properties / Array of strings for multi_select filter