DataTables 1.8 + Editable and Validation plug-in Javascript error [from Twitter]

DataTables 1.8 + Editable and Validation plug-in Javascript error [from Twitter]

tlloyduktlloyduk Posts: 13Questions: 0Answers: 0
edited September 2011 in Bug reports
Hi Guys,

I think I've spotted a bug when using DataTables 1.8 with TableTools, dataTables.editable makeEditable() function and the JQuery Validate plug-in. When you double click a cell to edit and you type something to trigger the keyup event, the following JavaScript error appears in Firebug:

[code]
f is undefined
[Break On This Error] "");f.settings[e]&&f.settings[e].call(...b[h]=e})});var d=this.settings.rules;
[/code]

This only happens if you define a validate() method for a form on the page, e.g. with:

[code]
$("#file_details_form").validate({
rules: {
file_title: {
required: true
},
}
});
[/code]

and I'm using TableTools with dataTables.editable, e.g.

[code]
$('#table').dataTable().makeEditable({
sDeleteURL: "/index.php/site/delete_row/",
sUpdateURL: "/index.php/site/update_row",
"aoColumns": [
null,
{},{},{}
]
});
[/code]

If you remove the .validate() function then it works as it should. With it there, it throws the error when you change the content of a cell.

I also tried defining the validate() function with keyup: false; in case it was something to do with that. It made no difference.

Cheers,

Tim

Versions:

jquery.dataTables.min.js - 1.8.0
TableTools.min.js - 2.0.1
jquery.dataTables.editable.js - 1.3

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Hi Tim,

    What happens if you disable TableTools - do you still get the error (I'm going to guess not)? The Editable plug-in for DataTables is 3rd party so not something I know a huge amount about, but if you could link us to your example (one which isn't using a minified version of the script since that can make debugging hard!) that would be really useful to help solving this.

    Thanks,
    Allan
  • redpaulredpaul Posts: 1Questions: 0Answers: 0
    I have the same error - commenting out the reference to tabletools made no difference.
This discussion has been closed.