Editor is giving me this error: "undefined is not a function"

Editor is giving me this error: "undefined is not a function"

DiegoTcDiegoTc Posts: 10Questions: 0Answers: 0
edited June 2013 in Editor
I have this part on my code:

[code]


var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"bProcessing": true,
"sAjaxSource": 'browser.jsp',
"domTable": "#example",
"fields": [ {
"label": "Browser:",
"name": "browser"
}, {
"label": "Rendering engine:",
"name": "engine"
}, {
"label": "Platform:",
"name": "platform"
}, {
"label": "Version:",
"name": "version"
}, {
"label": "CSS grade:",
"name": "grade"
}
]
} );

$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": 'browser.jsp',
"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",

"aoColumns": [
{ "mData": "browser" },
{ "mData": "engine" },
{ "mData": "platform" },
{ "mData": "version", "sClass": "center" },
{ "mData": "grade", "sClass": "center" }
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );




[/code]
I am getting this error : "undefined is not a function"
When I am assigning to editor the new function
editor = new $.fn.dataTable.Editor( {

Wondering why.

Thanks for your help.

Replies

  • allanallan Posts: 56,187Questions: 1Answers: 8,897 Site admin
    Have you included the Editor Javascript file? If so, can you link us to the test page so I can see what is going wrong?

    Allan
  • DiegoTcDiegoTc Posts: 10Questions: 0Answers: 0
    Yes that was my problem.
    Just in case someone has the same issue these are the includes

    [code]

    @import "../css/jquery.dataTables.css";
    @import "../css/TableTools.css";
    @import "../css/dataTables.editor.css";

    #container {
    padding-top: 60px !important;
    width: 960px !important;
    }
    #dt_example .big {
    font-size: 1.3em;
    line-height: 1.45em;
    color: #111;
    margin-left: -10px;
    margin-right: -10px;
    font-weight: normal;
    }
    #dt_example {
    font: 95%/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
    color: #111;
    }
    div.dataTables_wrapper, table {
    font: 13px/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
    }
    #dt_example h1 {
    font-size: 16px !important;
    color: #111;
    }
    #footer {
    line-height: 1.45em;
    }
    div.examples {
    padding-top: 1em !important;
    }
    div.examples ul {
    padding-top: 1em !important;
    padding-left: 1em !important;
    color: #111;
    }






    [/code]
This discussion has been closed.