Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Datatables.Net行cilck事件在第10行之后不工作_Jquery_Datatables - Fatal编程技术网

Jquery Datatables.Net行cilck事件在第10行之后不工作

Jquery Datatables.Net行cilck事件在第10行之后不工作,jquery,datatables,Jquery,Datatables,我正试图打开一个模式,在单击表格行的基础上用作编辑屏幕。但是,这仅适用于表的前10行 我用来获取行数据的代码是 $(document).ready(function () { $("tr").click(function () { //alert($(this.id).selector); $("#updateCase").modal(); }); }); 表是这样构建的,但有538行 <table id='tblProcessing' class='table

我正试图打开一个模式,在单击表格行的基础上用作编辑屏幕。但是,这仅适用于表的前10行

我用来获取行数据的代码是

$(document).ready(function () {
  $("tr").click(function () {
    //alert($(this.id).selector);
    $("#updateCase").modal();
  });
});
表是这样构建的,但有538行

<table id='tblProcessing' class='table table-striped table-hover table-border'>
 <thead>
  <tr>
  <th class='centre RequestId' hidden>RequestId</th>
  <th class='centre CMCReference'>CMC Reference</th>
  <th class='centre FirstCustomerName'>First Customer Name</th>
  <th class='centre FirstCustomerDOB'>First Customer DOB</th>
  <th class='centre SecondCustomerName'>Second Customer Name</th>
  <th class='centre SecondCustomerDOB'>Second Customer DOB</th>
  <th class='centre CustomerPostcode'>Customer Postcode</th>
  <th class='centre BusinessArea'>Business Area</th>
  <th class='centre AccountType'>Account Type</th>
  <th class='centre AccountOrCardNumber'>Account Or Card Number</th>
  <th class='centre LOAOutcome'>LOA Outcome</th>
  <th class='centre Outcome'>Outcome</th>
  <th class='centre Response'>Response</th>
  <th class='centre Complete'>Complete</th>
  <th class='centre Edit'>Edit</th>
  </tr>
 </thead>

 <tfoot class='foot'>
  <tr>
  <th>RequestId</th>
  <th>CMC Reference</th>
  <th>First Customer Name</th>
  <th>First Customer DOB</th>
  <th>Second Customer Name</th>
  <th>Second Customer DOB</th>
  <th>Customer Postcode</th>
  <th>Business Area</th>
  <th>Account Type</th>
  <th>Account Or Card Number</th>
  <th>LOA Outcome</th>
  <th>Outcome</th>
  <th>Response</th>
  <th>Complete</th>
  <th>Edit</th>
 </tr>
</tfoot>
<tbody>
  <tr id='2211'>
    <td class='centre RequestId' hidden>xxxx</td>
    <td class='centre CMCReference'>xxxxx</td>
    <td class='centre FirstCustomerName'>Susan Seymour</td>
    <td class='centre FirstCustomerDOB'>08/10/1981 </td>
    <td class='centre SecondCustomerName'></td>
    <td class='centre SecondCustomerDOB'></td>
    <td class='centre CustomerPostcode'>PE4 XXX</td>
    <td class='centre BusinessArea'></td>
    <td class='centre AccountType'>Mortgage</td>
    <td class='centre AccountOrCardNumber'>xxxxxxxx</td>
    <td class='centre LOAOutcome'>Not Seen</td>
    <td class='centre Outcome'></td>
    <td class='centre Response'></td>
    <td class='centre Complete'>True</td>
    <td class='centre Edit'><span class='btn><i id='xxxx' class='fa fa-pencil-square-o fa-2x edit' aria-hidden='true'></i></span></td>
  </tr>
 </tbody>

请求ID
CMC参考
第一个客户名称
第一客户DOB
第二个客户名称
第二客户DOB
客户邮政编码
业务领域
帐户类型
帐号或卡号
LOA结果
结果
回应
完成
编辑
请求ID
CMC参考
第一个客户名称
第一客户DOB
第二个客户名称
第二客户DOB
客户邮政编码
业务领域
帐户类型
帐号或卡号
LOA结果
结果
回应
完成
编辑
xxxx
xxxxx
苏珊·西摩
08/10/1981 
PE4 XXX
抵押贷款
xxxxxxxx
不见
真的

问题是因为下一页是由DataTable插件动态创建的,因此您需要使用委托事件处理程序:

$('#tblProcessing').on('click', 'tr', function () {
    //alert($(this.id).selector);
    $("#updateCase").modal();
});

完美的行了,谢谢你。我不能再接受11分钟的答案,但我会尽快接受。