0

尝试连接客户端/服务器接口以进行记录更新。Alles gute 直到最后一英里:将响应返回给客户端后,我收到此错误:

TypeError: f is undefined dataTables.editor.js (line 252 col 138)

回应是:

 {"data":        
[{"planid":null,"evnamelast":"Duck","eveligibleincome":3232,"DT_RowId":10003869,"evnamefirst"
:"Daffy","estart":1440054000000,"eligibilityversionid":10003869,"evpositionname   ":"Duck duck goose"}] }

列设置如下:

 var dispCols = [{
        data: null,
        defaultContent: '',
        className: 'select-checkbox',
        orderable: false
    },
    { data: "evnamefirst" },
    { data: "evnamelast" },
    { data: "evpositionname" },
    { data: "planid" },
    { data: "estart" },
    { data: "eveligibleincome", render: $.fn.dataTable.render.number( ',',    '.', 0, '$' ) }
];

数据表设置为:

  //Define the Editor
  editor = new $.fn.dataTable.Editor( {
    ajax: {
        "url": "/grid?pAction=UpdateRecs&recType=" + recType,
        "dataSrc": ""
    }, 
    idSrc: "eligibilityversionid",
    table: "#" + GRID_ID,
    /*fields: columns */
    fields: fields

 } );

 //Setup DataTable
 var table = $GRID.DataTable( {
dom: "Bfrtip",
ajax: {
    "url": "/grid?pAction=GetRecords&recType=" + recType,
    "dataSrc": ""
},       
columns: dispCols,
select: {
    style:    'os',
    selector: 'td:first-child'

},
buttons: [
    { extend: "create", editor: editor },
    { extend: "edit",   editor: editor },
    { extend: "remove", editor: editor }
  ]
} );

提前致谢!

4

1 回答 1

0

在 10 月 15 日问这个问题,现在是 2016 年 8 月。所以我要自己回答这个问题:

使用掌上电脑。

于 2016-08-21T19:12:04.413 回答