Javascript - yadcf过滤器OnClick事件在以后不起作用:
这是我的javascript代码:
var oTable;
$(document).ready(function(){
oTable = $('#example').dataTable().yadcf([
{column_number : 0},
{column_number : 3, filter_type: "range_number_slider", filter_container_id: "external_filter_container"},
{column_number : 2, text_data_delimiter: ",", filter_type: "auto_complete"},
{column_number : 1, text_data_delimiter: ",", filter_type: "auto_complete"},
{column_number : 4, column_data_type: "html", html_data_type: "text", filter_default_label: "Select tag", filter_type: "auto_complete"}]);
$(".label.lightblue" ).on( "click", function() {
yadcf.exFilterColumn(oTable, [[4, $(this).text()]]);
});
$(".label4.lightblue4" ).on( "click", function() {
yadcf.exFilterColumn(oTable, [[4, $(this).text()]]);
});
$(".label2.lightblue2" ).on( "click", function() {
yadcf.exFilterColumn(oTable, [[2, $(this).text()]]);
});
});
jsfiddle上的实例:http://jsfiddle.net/chcLmmps/