更新记录服务器 - >客户端时,数据表编辑器报告“TypeError f未定义”

时间:2015-10-02 18:18:18

标签: datatables jquery-datatables-editor

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

TypeError:f未定义             dataTables.editor.js(第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, '$' ) }
];

DataTables设置为:

  //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 }
  ]
} );

提前致谢!

1 个答案:

答案 0 :(得分:0)

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

使用handontable。