weixin_33737774 2019-12-10 02:57 采纳率: 0%
浏览 16

数据表未显示

I have here a on click event which display the table data inside the jquery confirm, but datatable wont display and it is not working even the display only of datatable, it only displays the normal table. can you tell me what's the problem why isnt working. thank you in advance. I put my table in jquery confirm and create a datatable function.

   $(document).on('click','.btnNotifyRecom',function (){

       var BranchCode = $(this).attr("id");
        var TranNo = $(this).attr("data-value");
        var TranType = $(this).attr("data-value1");

         $.confirm({
            title: 'Notify to Payroll Department',
            content: '' +
                '<form action="" class="formName">' +
                '<div class="form-group">' +
                '<label>Select Employee</label>' +

                 '<input class="form-control employees MySelect Content" placeholder="Enter ID/Name" list="employeename" id="EmployeeID" />'+
                 '<datalist id="employeename" class="EmployeeIDsubmit" style="width:10%"></datalist>'+

                '</select>' +
                '</div>' +
                 '</form>' +
                 '<table id="NotifyTable" class="table table-striped table-bordered table-sm cell-border compact stripe" style="width:100%; margin-top: 10px;"> '+
                '<thead><tr><th>Employee</th><th>Notify Date</th></tr></thead>' +
                ' <tbody id="NotifyTable"></tbody>' +

                '</table>',



            buttons: {
                formSubmit: {
                    text: 'Submit',
                    btnClass: 'btn-blue',
                    action: function () {
                        var Content = this.$content.find('.Content').val();
                        if (!Content) {
                            $.alert('Please Select Employee');

                            return false;
                        }
                        else {

                            $.ajax({
                                type: 'POST',
                                dataType: "json",
                                url: '@Url.Action("SubmitNotifyUser", "SummaryOBTOA")',
                                data: {
                                    'TranNo': TranNo,
                                    'BranchCode': BranchCode,
                                    'TranType': TranType,
                                    'Content': Content,
                                    'Action': 'NotifyRecome',
                                }
                            });


                            $.alert('Employee Number: ' + Content + ' has been notified');
                            return false; 
                        }
                    }
                },
                cancel: function () {
                    //close
                },
            },
            onContentReady: function () {
                // bind to events
                var jc = this;
                this.$content.find('form').on('submit', function (e) {
                    // if the user submits the form by pressing enter in the field.
                    e.preventDefault();
                    jc.$$formSubmit.trigger('click'); // reference the button and click it
                });
            }
         });


       $('#NotifyTable').DataTable({


        "language": {
            emptyTable: "No Transaction"

        },
        ajax: {
              url: '@Url.Action("GetNotifyUsers", "SummaryOBTOA")',
            data: {

            'TranNo': TranNo,
                'TranType': TranType,
                'BranchCode': BranchCode,
            'NotifyType':  'NotifyRecome',
                 },
            dataType: "json",
            retrieve: "true",
            processing: "true",
            serverSide: "true",

            type: "POST",
            dataSrc: "",

        },
        order: [],
        columnDefs: [
            {
                targgets: [1],
                orderable: false,
            }

                   ],

                    columns: [

            { data: "EmpName" },
            { data: "NotifyDate" }


                ]

               });

              });
  • 写回答

0条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 GEO下载数据的处理报错 :函数‘Meta’标签‘"data.frame"’找不到继承方法,如何解决?
      • ¥15 DLNM模型是否可以用二分类变量作为y变量
      • ¥15 android object box 一个实体多个表怎么写
      • ¥15 temux 启用docker 服务失败
      • ¥15 Flask 使用celery发送邮件出现‘目标计算机积极拒绝‘
      • ¥60 老人用的sd卡在手机里面不知道操作了什么,导致图片和视频变成了文件,取下sd卡连接电脑就是图中的样子,后缀改为.jpg才可以,需要用系统的画图软件才能打开,文件属性还是文件,有没有批量操作的解决办法
      • ¥15 超时跳出方法代码的返回值问题
      • ¥15 汇编语言程序设计设计,ascii码求数,再求数的BCD码
      • ¥30 Mask rcnn训练自己的数据集出现问题!
      • ¥20 研究人工智能时的几个问题