【发布时间】:2015-03-12 09:25:42
【问题描述】:
我看到了这个用于数据表的过滤 yadcf 演示:Live Demo
您可以按标签过滤表格,但不能单击Tag1 或Tag2 来像过滤表格结果一样使用它们,并且只返回具有Tag1 或Tag2 的行。
是否可以像可点击标签过滤器模式一样在表格内使用标签?
哪些代码必须在jquery.datatables.yadcf.js 中编辑/添加?
在上面的演示中,这是代码的一部分。如何在column_number: 4或标签栏实现我的功能请求?
$(document).ready(function () {
'use strict';
//----------------------------------------------
// this is the code for column tag
//----------------------------------------------
oTable = $('#example').dataTable({
"bJQueryUI": true,
"bStateSave": true
}).yadcf([{
......
......
{
column_number: 4,
select_type: 'select2',
select_type_options: {
width: '150px'
placeholder: 'Select tag',
allowClear: true // show 'x' (remove) next to selection inside the select itself
},
column_data_type: "html",
html_data_type: "text",
filter_reset_button_text: false // hide yadcf reset button
}]);
SyntaxHighlighter.all();
哪些参数必须编辑?
column_number
filter_type
custom_func
data
column_data_type
text_data_delimiter
html_data_type
filter_container_id
filter_default_label
filter_reset_button_text
enable_auto_complete
sort_as
sort_order
date_format
ignore_char
filter_match_mode
select_type
select_type_options
case_insensitive
filter_delay
【问题讨论】:
-
您的意思是您希望能够单击表格行本身内部的标签,而不是标题中的下拉菜单?
-
是的,就是这样,在表格行内。
标签: javascript jquery datatable yadcf