Editor throws error upon hitting "edit":
Editor throws error upon hitting "edit":
I'm just getting my feet wet with the editor (1.2.0). I am trying to get the simplest example running, the one using TableTools.
I get a nice lightbox with the Add and Delete button clicks. But the Edit button fails when clicked, I get the error:
Uncaught TypeError: Object # has no method 'replace'
I'm wondering if I missed adding a script, or maybe my jQuery is too old (1.4.4). Here's a Chrome stack trace, and my scripts and init code is below.
Uncaught TypeError: Object # has no method 'replace' jquery-1.4.4.min.js:104
t.querySelectorAll.k jquery-1.4.4.min.js:104
c.fn.extend.find jquery-1.4.4.min.js:108
j.$ jquery.dataTables.min.js:100
j._ jquery.dataTables.min.js:100
f.edit dataTables.editor.min.js:31
o.TableTools.l.editor_edit.d.extend.fnClick dataTables.editor.min.js:54
TableTools._fnTextConfig TableTools.min.js:51
c.event.handle jquery-1.4.4.min.js:67
c.event.add.h.handle.o jquery-1.4.4.min.js:60
I'm sure it's something boneheaded I'm doing, but maybe what it is will leap out for someone.
Matt
P.S. Also, maybe this is similar to ecostellos question below?
[code]
var dtFind;
var dteditor;
$(document).ready(function () {
dteditor = new $.fn.dataTable.Editor({
"ajaxUrl": "php/MWCTODO.browsers.php",
"domTable": "#find_table",
"fields": [{
"label": "Browser:",
"name": "browser"
}, {
"label": "Rendering engine:",
"name": "engine"
}, {
"label": "Platform:",
"name": "platform"
}, {
"label": "Version:",
"name": "version"
}, {
"label": "CSS grade:",
"name": "grade"
}]
});
dtFind = $('#find_table').dataTable({
"bFilter": false,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [] }
],
"iDisplayLength": 25,
"aaSorting": [],
//using sDom enables the buttons, but hides the record_count_show dropdown.
"sDom": 'Tfrtip',
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": dteditor },
{ "sExtends": "editor_edit", "editor": dteditor },
{ "sExtends": "editor_remove", "editor": dteditor }
]
}
});
});
[/code]
I get a nice lightbox with the Add and Delete button clicks. But the Edit button fails when clicked, I get the error:
Uncaught TypeError: Object # has no method 'replace'
I'm wondering if I missed adding a script, or maybe my jQuery is too old (1.4.4). Here's a Chrome stack trace, and my scripts and init code is below.
Uncaught TypeError: Object # has no method 'replace' jquery-1.4.4.min.js:104
t.querySelectorAll.k jquery-1.4.4.min.js:104
c.fn.extend.find jquery-1.4.4.min.js:108
j.$ jquery.dataTables.min.js:100
j._ jquery.dataTables.min.js:100
f.edit dataTables.editor.min.js:31
o.TableTools.l.editor_edit.d.extend.fnClick dataTables.editor.min.js:54
TableTools._fnTextConfig TableTools.min.js:51
c.event.handle jquery-1.4.4.min.js:67
c.event.add.h.handle.o jquery-1.4.4.min.js:60
I'm sure it's something boneheaded I'm doing, but maybe what it is will leap out for someone.
Matt
P.S. Also, maybe this is similar to ecostellos question below?
[code]
var dtFind;
var dteditor;
$(document).ready(function () {
dteditor = new $.fn.dataTable.Editor({
"ajaxUrl": "php/MWCTODO.browsers.php",
"domTable": "#find_table",
"fields": [{
"label": "Browser:",
"name": "browser"
}, {
"label": "Rendering engine:",
"name": "engine"
}, {
"label": "Platform:",
"name": "platform"
}, {
"label": "Version:",
"name": "version"
}, {
"label": "CSS grade:",
"name": "grade"
}]
});
dtFind = $('#find_table').dataTable({
"bFilter": false,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [] }
],
"iDisplayLength": 25,
"aaSorting": [],
//using sDom enables the buttons, but hides the record_count_show dropdown.
"sDom": 'Tfrtip',
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": dteditor },
{ "sExtends": "editor_edit", "editor": dteditor },
{ "sExtends": "editor_remove", "editor": dteditor }
]
}
});
});
[/code]
This discussion has been closed.
Replies
Thanks,
Allan