Cannot extend unknown button type: create

Cannot extend unknown button type: create

HakuHaku Posts: 4Questions: 1Answers: 0
edited January 2016 in Free community support

Anyone could help me with this error?

This is my code:

<script src="{% static "private/design_one/js/datatables_editor/jquery.dataTables.min.js" %}"></script>
    <script src="{% static "private/design_one/js/datatables_editor/dataTables.buttons.min.js" %}"></script>
    <script src="{% static "private/design_one/js/datatables_editor/dataTables.select.min.js" %}"></script>
    <script src="{% static "private/design_one/js/datatables_editor/dataTables.editor.min.js" %}"></script>

    <script>
    $(document).ready(function() {

        var editor = new $.fn.dataTable.Editor( {
            ajax:  '/api/staff',
            table: '#phones',
            fields: [
                { label: 'First name', name: 'first_name' },
                { label: 'Last name',  name: 'last_name'  },
                // etc
            ]
        } );

        $('#phones').DataTable( {
            dom: "Bfrtip",
            processing: true,
            serverSide: true,
            ajax: "{{ api_url }}",
            dataSrc: 'data',
            columns: [
                { data: 'id' },
                { data: 'client.name' },
                { data: 'client.comercial_name' },
                { data: 'number' }
            ],
            paging: true,
            select: true,
            buttons: [
                { extend: "create", editor: editor },
                { extend: "edit",   editor: editor },
                { extend: "remove", editor: editor }
            ]
        });
    } );
    </script>

Answers

  • allanallan Posts: 61,611Questions: 1Answers: 10,089 Site admin

    What version of Editor are you loading in?

    Allan

  • HakuHaku Posts: 4Questions: 1Answers: 0

    DataTables 1.10.10
    dataTables.editor.min.js Version: 1.5.4

    any ideas?

  • allanallan Posts: 61,611Questions: 1Answers: 10,089 Site admin

    That's odd - I was expecting 1.4 or earlier based on the error you are seeing. The create button was added in 1.5.0.

    Could you give me a link to the page you are working on so I can debug it please?

    Thanks,
    Allan

  • HakuHaku Posts: 4Questions: 1Answers: 0

    For the moment it's a local development but I can configure a new server instance for your debug, if it is needed.

    Yesterday I decided realize a new test changing the code basing on this example https://editor.datatables.net/examples/simple/inTableControls.html

    But now the error is the following: TypeError: o[m] is undefined

    I thought it would be easier...

  • allanallan Posts: 61,611Questions: 1Answers: 10,089 Site admin

    Heh - unfortunately not. I'm afraid I don't know what would cause the error you are seeing there - the o[m] is part of the obfuscated trial code.

    Allan

  • HakuHaku Posts: 4Questions: 1Answers: 0

    What can I do? any ideas?

  • allanallan Posts: 61,611Questions: 1Answers: 10,089 Site admin

    I'd need a link to the page please.

    Allan

This discussion has been closed.