尝试添加函数对数据进行排序时,参数列表后未捕获到的SyntaxError:缺少)

我遇到了错误:

参数列表后未捕获的SyntaxError:缺少

使用以下Javascript:

jQuery.extend(cipMonitorErrorsSettings,{
    loadOnStartup: true,columnDefs: [{
        "mData": "createdDate","bSortable": true,"sTitle": '<fmt:message key="card.cipErrors.createdDate"/>',"mRender": function(data,type,cipErrors) { //new
          return '<button class="cipSummary buttonlink createdDate">' + cipErrors.createdDate + '</button>'; //new
        }
      },{
        "mData": "status","sTitle": '<fmt:message key="card.cipErrors.status"/>'
      },{
        "mData": "jsonRequest","sTitle": '<fmt:message key="card.cipErrors.jsonRequest"/>'
      },{
        "mData": "jsonResponse","sTitle": '<fmt:message key="card.cipErrors.jsonResponse"/>'
      }

    ],editLinks: [{ //Edit
      selector: ".cipSummary",callback: function(target,data) {
        //  debugger;
        $ {
          prefix
        }
        actionFormHandler.open(data);
      },disabled: $ {
        actionBean.restricted['RESTRICT_EDIT']
      }

    }],postInitCallback: function() {
      console.log(this.container.find(".appendImage"));
    },actionButtons: {
      exportText: '<fmt:message key="export.csv"/>'
    }


  }
  $(document).ready(function(data) {
    $('#cipTable').DataTable({
      "order": [
        [3,"desc"]
      ],"columnDefs": [{
          targets: 0,data: "createdDate"
        },{
          targets: 1,data: "status"
        },{
          targets: 2,data: "jsonRequest"
        },{
          targets: 3,data: "jsonResponse"
        }
      ]
    })
  });
);

我已经检查并再次检查并尝试了很多次,但仍然无法摆脱此错误。我还添加了一个调试器,但可以找到它发生的位置。我正在尝试显示列,但按createdDate列排序。

chunbaise0601 回答:尝试添加函数对数据进行排序时,参数列表后未捕获到的SyntaxError:缺少)

尝试这样的脚本,我删除了最后一个“);”在脚本末尾。

jQuery.extend(cipMonitorErrorsSettings,{
    loadOnStartup: true,columnDefs: [{
        "mData": "createdDate","bSortable": true,"sTitle": '<fmt:message key="card.cipErrors.createdDate"/>',"mRender": function(data,type,cipErrors) { //new
          return '<button class="cipSummary buttonlink createdDate">' + cipErrors.createdDate + '</button>'; //new
        }
      },{
        "mData": "status","sTitle": '<fmt:message key="card.cipErrors.status"/>'
      },{
        "mData": "jsonRequest","sTitle": '<fmt:message key="card.cipErrors.jsonRequest"/>'
      },{
        "mData": "jsonResponse","sTitle": '<fmt:message key="card.cipErrors.jsonResponse"/>'
      }

    ],editLinks: [{ //Edit
      selector: ".cipSummary",callback: function(target,data) {
        //  debugger;
        $ {
          prefix
        }
        ActionFormHandler.open(data);
      },disabled: $ {
        actionBean.restricted['RESTRICT_EDIT']
      }

    }],postInitCallback: function() {
      console.log(this.container.find(".appendImage"));
    },actionButtons: {
      exportText: '<fmt:message key="export.csv"/>'
    }


  }
  $(document).ready(function(data) {
    $('#cipTable').DataTable({
      "order": [
        [3,"desc"]
      ],"columnDefs": [{
          targets: 0,data: "createdDate"
        },{
          targets: 1,data: "status"
        },{
          targets: 2,data: "jsonRequest"
        },{
          targets: 3,data: "jsonResponse"
        }
      ]
    })
  });

本文链接:https://www.f2er.com/2688411.html

大家都在问