Getting Selectors to Work to Delete Records

Getting Selectors to Work to Delete Records

Dave MDave M Posts: 7Questions: 0Answers: 0

After hours of fiddling, stuck on getting selectors to work to delete records and create new records.
I get the selector column to appear but thats all. Buttons for Create and Remove don't show up either.
No errors show up in the console log.

What am I missing to get the Create and Remove buttons to show up and enable the row selectors?

Thanks

See http://www.campadk.com/test/tables.php

Replies

  • Dave MDave M Posts: 7Questions: 0Answers: 0

    Was missing a few .js files which I added. Now stuck with...

    dataTables.editor.min.js:984 Uncaught TypeError: Cannot read property 'i18n' of null
    at text (dataTables.editor.min.js:984)
    at f (dataTables.buttons.min.js:13)
    at m._buildButton (dataTables.buttons.min.js:14)
    at m._expandButton (dataTables.buttons.min.js:12)
    at m.add (dataTables.buttons.min.js:7)
    at m._constructor (dataTables.buttons.min.js:10)
    at new m (dataTables.buttons.min.js:6)
    at Object.fnInit (dataTables.buttons.min.js:38)
    at mb (jquery.dataTables.min.js:33)
    at ga (jquery.dataTables.min.js:48)

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765

    You need to reverse the editor and datatables init code. This:

          buttons: [
                { extend: "create", editor: editor },
                { extend: "remove", editor: editor }
          ]
    

    Is referring to the editor variable which hasn't been set to the Editor yet.

    Also noticed a syntax error which will cause problems:

       <script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"</script>
       <script src="https://cdn.datatables.net/select/1.2.3/js/dataTables.select.min.js"></script>
    

    You are missing a > in this area: dataTables.buttons.min.js"</script>. It should be dataTables.buttons.min.js"></script>.

    Kevin

  • Dave MDave M Posts: 7Questions: 0Answers: 0

    Thanks Kevin! That solved everything. Much appreciated!

This discussion has been closed.