bootstraptable中onExpandRow属性---js  方法添加的 html代码,然后给这代码里面的 元素 添加 事件,却获取不该元素。(称之为未来元素),由于是未来的 所以现在没有这个元素,导致获取不到。

//代码不会触发点击事件;
//$("#btn_export_curr_page_detail").click(function () {
                //    var attribute = $('#btn_export_curr_page_detail').attr('data-attribute6');
                //    AjaxRequest_CreateExcelFromCurrPageDetail(attribute);
                //});

 

 onExpandRow: function (index, row, $detail) {
                    var cur_table = $detail.html('<table >);
                    var html = "";
                    html += '<div >;
                    html += '    <button >;
                    html += '        <span class="glyphicon glyphicon-export" aria-hidden="true"></span>@Html.LocText("ExportCurrentPage", "导出本页到Excel")';
                    html += '    </button>';
                    html += '    <input type="hidden" >;
                    html += '</div>';

 

$("#report-query-baselist-table").on("click", '#detailToolbar .export-curr-page-detail', function () {
                    var attribute = $(this).attr('data-attribute6');
                    AjaxRequest_CreateExcelFromCurrPageDetail(attribute);
                });

  

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2021-05-08
猜你喜欢
  • 2022-02-03
  • 2021-12-09
  • 2021-07-11
  • 2021-12-29
  • 2021-05-01
  • 2022-02-10
相关资源
相似解决方案