带有Tabledit jQuery的DataTable

时间:2019-12-04 10:10:44

标签: jquery datatable tabledit

我正在尝试将这两个脚本链接在一起。datatable部分很棒。只有我无法编辑任何内容。有谁知道如何正确地做这件事?

$(document).ready(function() {
  $('#user-table').DataTable({
    "processing": true,
    "ajax": {
      url: "index.php?GOTO=AJAX_User_Bearbeiten_Controller/get_Table",
      type: "POST"
    },
    "columns": [{
      "data": "User_ID"
    }, {
      "data": "User_Name"
    }, {
      "data": "Vor_Name"
    }, {
      "data": "EMail"
    }, {
      "data": "Zuletzt_Aktiv"
    }, {
      "data": "Aktiv"
    }]
  });

  $('#user-table').Tabledit({
    url: 'index.php?GOTO=AJAX_Test_Controller/set_Table',
    editButton: false,
    restoreButton: false,
    deleteButton: false,
    confirmButton: false,
    columns: {
      identifier: [0, 'User_ID'],
      editable: [
        [1, 'User_Name'],
        [2, 'Vor_Name'],
        [3, 'EMail'],
        [4, 'Zuletzt_Aktiv'],
        [5, 'Aktiv']
      ]
    },
    onAjax: function(action, serialize) {
      console.log('onAjax(action, serialize)');
      console.log(action);
      console.log(serialize);
    }
  });
});

0 个答案:

没有答案