Problems occur when switching using the jqueryDataTable tab

$("- sharpnav-tabs li"). On ("click",function () {

)
        $("-sharpnav-tabs li").removeClass("active");
        $(this).addClass("active");
        that.currentIndex=$(this).index();
        that.initTableData();

})

initTableData:function () {

    var that = this;
    console.log(that.currentIndex)
    var returnData = "";
    var columns="";
    if(that.currentIndex==0){
        returnData = [
            {pjwd:"b",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
        ];

        columns=[
                {"data": null, title: "", "width": "5%"},
                {"data": "ejzb", title: "", "width": "12%"},
                {"data": "pjzb", title: "", "width": "12%"},
                {"data": "sjly", title: "", "width": "12%"},
                {"data": "ccc", title: "", "width": "12%"},
                {"data": "pjwd", title: "", "width": "12%"},
        ];
    }
    if(that.currentIndex==1){
        returnData = [
            {pjwd:"b",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
        ];
        columns=[
                {"data": null, title: "", "width": "5%"},
                {"data": "pjwd", title: "/", "width": "10%"},
                {"data": "ejzb", title: "", "width": "12%"},
                {"data": "pjzb", title: "", "width": "12%"},
                {"data": "sjly", title: "", "width": "12%"},
                {"data": "ccc", title: "", "width": "12%"},
                {"data": "bb", title: "", "width": "12%"},
        ];
       
    }
    if(that.currentIndex==2){
        returnData = [
            {pjwd:"c",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
            {pjwd:"",ejzb:"",pjzb:"",sjly:"()",ccc:"14.16",bb:"22"},
        ];
        columns=[
                {"data": null, title: "", "width": "5%"},
                {"data": "pjwd", title: "/", "width": "10%"},
                {"data": "ejzb", title: "", "width": "12%"},
                {"data": "pjzb", title: "", "width": "12%"},
                {"data": "sjly", title: "", "width": "12%"},
                {"data": "ccc", title: "", "width": "12%"},
                {"data": "bb", title: "", "width": "12%"},
        ];

    }
    // $.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust();
     var t=$("-sharpunit-table").dataTable({
            data: returnData,
            language: trans(),
            sDom: ""top"i",
            pageLength: 10,
            autoWidth: false,
            destroy: true,
            info: true,
            ordering: false,
            columns: columns,
           
    });
}

clipboard.png

Mar.02,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c22d5e-47bb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c22d5e-47bb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?