Using TableTools with DataTables Editor - "TableTools: Warning - unknown button type: editor_remove"

Using TableTools with DataTables Editor - "TableTools: Warning - unknown button type: editor_remove"

renderationrenderation Posts: 3Questions: 0Answers: 0
edited May 2012 in General
I'm trying to use the basic example given on editor.datatables.net, but I get this error instead when the page loads. FireBug tells me that all of the JS/CSS mentioned below are being found and there are no errors. I'm not using any other files in the TableTools media folder. Is there any other file I need for the Remove button to show properly or am I doing something wrong with TableTools/Editor?

The HTML code:
[code]


<!-- CSS and JS -->









// calls initTable()






[/code]

Here's the JavaScript function that gets called on page load:
[code]
/*
* Initializes DataTable and its editor.
*/
var editor;
var oTable;
function initTable(){
// Create an editor object for the table.
editor = new $.fn.dataTable.Editor({
"ajaxUrl": "MyServlet",
"domTable": "#table"
});

// Initialize the table.
oTable = $('#table').dataTable({
"sDom": 'T<"clear">lfrtip',
"sAjaxSource": "MyServlet",
"aoColumns": [
{"mDataProp": "Col1", "sTitle": "Col 1"}
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{"sExtends": "editor_remove", "editor": editor}
]
}
});
}
[/code]

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Editor has a dependency on TableTools (if you are using the buttons), so you need to load TableTools first:

    [code]



    [/code]

    and that should do it :-)

    Allan
  • burncharburnchar Posts: 118Questions: 12Answers: 0
    Good thing to mention in the Editor docs. :)
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Excellent point - I'll update the 'required' modules in the documentation to indicate that if TableTools support is wanted (it is optional :-) ) then TableTools should be loaded up first. This will be in the documentation for the next Editor release.

    Allan
This discussion has been closed.