Cannot set property 'sButtonText' of undefined

Cannot set property 'sButtonText' of undefined

rbogerrboger Posts: 1Questions: 0Answers: 0
edited February 2014 in Editor
I end up with this error when initializing editor using setting similar to the DOM sourced example. If I initialize the datatable without editor I get the previously mentioned bug where editor_create buttons etc. are not recognized. This is not cleared up by going to the nightly build of tabletools. Is this an issue with the versions of datatables, tabletools, and editor that I am using, or is it somewhere in my rather basic javascript?


var editor;
var table;

$(document).ready(function () {
editor = new $.fn.dataTable.Editor({
"domTable": "#optable",
"ajaxUrl": {
"create": "@Url.Action("Create")",
"edit": "@Url.Action("Edit")",
"remove": "@Url.Action("Delete")"
},

"fields": [{
"label": "Operator ID: ",
"name": 0
},{
"label": "First Name:",
"name": 1
}, {
"label": "Last Name:",
"name": 2
}, {
"label": "Department ID:",
"name": 3
}, {
"label": "Do Not Use In List: ",
"name": 4
}, {
"label": "NTLogin: ",
"name": 5
}, {
"label": "Permission Level: ",
"name": 6,

}]
});



table = $("#optable").dataTable({
"sDom": 'Tfrtip',
"domTable" : "#optable",
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}

});
});




Any insight would be much appreciated

Replies

  • allanallan Posts: 61,787Questions: 1Answers: 10,115 Site admin
    Any chance you can link us to the page?

    The load order for the scripts should be:

    1. jQuery
    2. DataTables
    3. TableTools
    4. Editor

    Might 3 and 4 be swapped around?

    Allan
  • NathanHadleyNathanHadley Posts: 3Questions: 1Answers: 0

    I was having the same problem, the order of the scripts being loaded was indeed the issue. Thanks!

This discussion has been closed.