3

I'm new to Datatables and I'm trying to make the table editable, but I keep getting this error:

TypeError: $(...).dataTable(...).makeEditable is not a function

My jQuery script looks like this:

    $(document).ready( function () {
    var oTable = $('#data_table_wrapper').dataTable({
        "sDom": 'R<"H"lfr>t<"F"ip<',
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "aoColumn": [
                { "bVisible": true },
                { "bVisible": true },
                { "bSortable": false },
                    ]       
    }).makeEditable({
        sUpdateURL: "/abc.php"
    });
});

I am including these files:

jquery-1.9.1.min.js
jquery.dataTables.min.js
jquery.jeditable.js
jquery.dataTables.editable.js
jquery-ui.js
jquery.validate.js

All links to these files work correctly. Can anyone give me some advice, please? Why do I keep getting that error?

Dropout
  • 12,137
  • 9
  • 47
  • 96
  • http://stackoverflow.com/questions/7907111/jquery-datatable-makeeditable-not-a-function-error maybe this helps? if not post more code please, including the imports. – OschtärEi Feb 06 '13 at 09:08
  • Nope :( All the links are OK.. Is the order of the imports correct? What exactly should I post, if the links are OK? Thanks – Dropout Feb 06 '13 at 09:22
  • hmm checkout this page http://code.google.com/p/jquery-datatables-editable/wiki/HTMLSource. The order is different. Maybe you try to just do this simple example first (no more code than he has) and then adopt it to your code. Sorry can't help more :S – OschtärEi Feb 06 '13 at 09:42
  • Figured it out a while ago. I'll post the answer. Thanks anyway! – Dropout Feb 06 '13 at 10:33

3 Answers3

9

The imports have to be in certain order:

jquery.min.js

jquery-ui.min.js

jquery.dataTables.min.js

jquery.jeditable.js

jquery.dataTables.editable.js

jquery.validate.js

After fixing this, update to latest versions fixed the problem!

Community
  • 1
  • 1
Dropout
  • 12,137
  • 9
  • 47
  • 96
0

For jQuery version 1.9.1 jQuery datatable won't work. Try using jQuery version 1.7.1 instead.

brezanac
  • 8,750
  • 4
  • 38
  • 57
  • This seems to conflict with the information provided in Dropout's answer. Care to elaborate? – TZHX May 05 '15 at 12:46
  • Seems the accepted answer tells another thing, and also instructing people to downgrade their libraries is not recommendable. – Cristik May 05 '15 at 12:55
  • If you have a new question, please ask it by clicking the [Ask Question](http://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. – Eric Leschinski May 05 '15 at 14:16
  • I don't see a reason why they shouldn't work.. Please remove your post, this is not an answer. Thanks. – Dropout May 06 '15 at 10:20
0

My situation was:

(jQuery 3.x)

from jQuery DataTables website I had following:

<script>
    $(element).DataTable().makeEditable();
</script>

So - at first I had to change "DataTable" to "dataTable" giving:

<script>
    $(element).dataTable().makeEditable();
</script>

Then it threw the error (in jquery.dataTables.editable.js): TypeError: $(...).live is not a function. Which I fixed according to this topic jQuery 1.9 .live() is not a function :

line 655:

//$(".table-action-deletelink", oTable).live("click", function (e) {
$(oTable).on("click", ".table-action-deletelink", function (e) {