Trying to implement bulkedit / multi-row edit. Error: unknown button type: edit

Trying to implement bulkedit / multi-row edit. Error: unknown button type: edit

marcelvmarcelv Posts: 27Questions: 6Answers: 0

Hi,

I`m trying to implement this example:
https://editor.datatables.net/manual/multi-row

However, at the moment this does not seem to work. I get Error: unknown button type: edit on load of page.

I already succesfully use other buttons like Print, Edit, New, etc. But for example the current edit button is: editor_edit. The example shows I need to use 'edit', but that throws an error.

How to fix this?

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    Have you loaded the Editor Javascript? It is Editor's Javascript that defined the edit button type.

    If you are able to give a link to the page I can take a look.

    Allan

  • marcelvmarcelv Posts: 27Questions: 6Answers: 0

    Hi,

    these are my includes:

    <script src="<?php echo $fileLoc ?>includes/js/jquery-1.9.1.min.js"></script>
    <script src="<?php echo $fileLoc ?>includes/js/jquery-ui.min.js"></script>
    <script type="text/javascript" language="javascript" src="<?php echo $fileLoc  ?>includes/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" language="javascript" src="<?php echo $fileLoc  ?>includes/js/dataTables.tableTools.min.js"></script>
    <script type="text/javascript" language="javascript" src="<?php echo $fileLoc  ?>includes/js/dataTables.editor.min.js"></script>
    
  • marcelvmarcelv Posts: 27Questions: 6Answers: 0

    Am I missing something? Because I don`t have it online yet (pure locally) I cannot show you at the moment.

    This is how I init Editor:

    var editor; // use a global for the submit and return data rendering in the examples
            editor = new $jq.fn.dataTable.Editor( {
                ajax: "productview_editable_processing",
                table: tableId,
                fields: jsAttLabelMap
            } );
    

    And this is how I init my datatable:

    oTable = $jq(tableId).DataTable( {
                "dom": 'T<"clear">lfrtip',
                "tableTools": {
                    "sSwfPath": "<?php echo $this->registry->madminbase ?>includes/swf/copy_csv_xls_pdf.swf",
                    "sRowSelect": "os",
                        "sRowSelector": 'td:first-child',
                        "aButtons": [
                            { sExtends: "editor_edit",   editor: editor, "sButtonText": "<?php echo $lang['edit']; ?>)", },
                            { sExtends: "edit",   editor: editor, "sButtonText": "<?php echo $lang['edit_bulk']; ?>", },
                            { sExtends: "editor_remove", editor: editor, "sButtonText": "<?php echo $lang['delete']; ?>" },
    ..... 
    

    Datatables and editor are working fine, inline edit is working, bubble editing is. Works all great, except for the multi row edit.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Okay - thanks for the code. I see you are using the TableTools extension rather than Buttons.

    The name of the button types for TableTools are editor_edit, editor_create and editor_remove (like you have for the first and third buttons in your list). There is not TableTools edit button type - that is for the Buttons extension.

    I should note that TableTools has now been retried in favour of Buttons.

    Allan

  • marcelvmarcelv Posts: 27Questions: 6Answers: 0

    Hi Allan,

    Thanks a lot! So you would suggest keep using TableTools, or did I misunderstand that part?

    But TableTools does not support multirow editing button, right?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I would suggest using Buttons over TableTools, unless TableTools is deeply embedded in your code. imho Buttons is a huge improvement over TableTools.

    But TableTools does not support multirow editing button, right?

    Correct.

    Allan

  • marcelvmarcelv Posts: 27Questions: 6Answers: 0
    edited August 2015

    Ah, I get it. Thanks! Will see if I can move to Buttons. I'm just using the default datatables buttons such as export CSV, print, select all so won`t be too big of a problem I hope. Thanks again!

This discussion has been closed.