【发布时间】:2015-10-20 02:29:40
【问题描述】:
如何让搜索/过滤器按列工作?
我正在构建小步骤,并不断添加到我的数据表中,这在这个阶段非常动态。它基本上基于输入的数据构建数据表。我现在添加了页脚作为搜索/过滤器,但不幸的是,这是我卡住的地方。我无法让文件管理器部分工作。非常感谢您的建议。
这是我正在处理的示例数据表http://live.datatables.net/qociwesi/2/edit
它基本上具有按表构建的 dTableControl 对象。
要构建我的表,我需要调用 loadDataFromSocket 来执行以下操作:
//then I have this function for loading my data and creating my tables
//file is an array of objects
//formatFunc is a function that formats the data in the data table, and is stored in options for passing to the dTableControl for formatting the datatable - not using this in this example
//ch gets the keys from file[0] which will be the channel headers
//then I add the headers
//then I add the footers
//then I create the table
//then i build the rows using the correct values from file
//then I draw and this then draws all the row that were built
//now the tricky part of applying the search to each columns
所以我已经做到了这一点,但每列的搜索不起作用。如何让搜索/过滤器按列工作?
请注意,这是我一直在研究的一个非常基本的工作示例:http://jsfiddle.net/HattrickNZ/t12w3a65/
【问题讨论】:
标签: filter datatables