OnClick 事件不适用于超过 10 个条目的值

OnClick event doesn't work for values over 10 entries

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/

标记(标签)是动态添加的,因此它们没有附加事件。而不是 .click() 使用 .on 像这样 .

$('#example').on('click',".label.lightblue", function () {
    alert('onclick label');
    yadcf.exFilterColumn(oTable, [
        [4, $(this).text()]
    ]);
});

.label4.lightblue4.label2.lightblue2

也是如此

这是一个DEMO

希望这对您有所帮助。