dataTables.editor.min.js:20 Uncaught TypeError: $[C4n] is not a function

dataTables.editor.min.js:20 Uncaught TypeError: $[C4n] is not a function

ajungajung Posts: 14Questions: 5Answers: 0

I am currently trying to port an older DT-based application (from 2018) to latest Editor and DT versions.
DT (loaded from CDN), Editor 2.3.2 trial.

I get this error when I try to "create" or "update" the data from a row:

dataTables.editor.min.js:20 Uncaught TypeError: $[C4n] is not a function
at Editor._ajax (dataTables.editor.min.js:20:114961)
at dataTables.editor.min.js:20:144274
at Editor._event (dataTables.editor.min.js:20:123756)
at Editor._submit (dataTables.editor.min.js:20:144055)
at dataTables.editor.min.js:20:101902
at Editor._event (dataTables.editor.min.js:20:123756)
at send (dataTables.editor.min.js:20:101686)
at Editor.submit (dataTables.editor.min.js:20:102224)
at Editor.action (dataTables.editor.min.js:20:214500)
at HTMLButtonElement.<anonymous> (dataTables.editor.min.js:20:81825)
_ajax @ dataTables.editor.min.js:20
(anonymous) @ dataTables.editor.min.js:20
_event @ dataTables.editor.min.js:20
_submit @ dataTables.editor.min.js:20
(anonymous) @ dataTables.editor.min.js:20
_event @ dataTables.editor.min.js:20
send @ dataTables.editor.min.js:20
submit @ dataTables.editor.min.js:20
action @ dataTables.editor.min.js:20
(anonymous) @ dataTables.editor.min.js:20
dispatch @ jquery-3.3.1.slim.min.js:2
v.handle @ jquery-3.3.1.slim.min.js:2

The editor configuration looks like this:

const editor = new $.fn.dataTable.Editor({ 
  table: '#myTable',
  ajax: '/kataster/update',
  fields: [
      {
          label: 'gebaeude',
          name: 'gebaeude'
      },
      {
          label: 'etage',
          name: 'etage'
      },
      {
          label: 'raum',
          name: 'raum'
      },
      {
          label: 'bezeichnung',
          name: 'bezeichnung'
      },
      {
          label: 'cas_nr',
          name: 'cas_nr'
      },
      {
          label: 'menge',
          name: 'menge'
      },
      {
          label: 'mengeneinheit',
          name: 'mengeneinheit'
      },
      {
          label: 'kennung',
          name: 'kennung'
      },
      {
          label: 'status',
          name: 'status'
      },
  ],

});

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I see you're using Editor in your example, but our accounts aren't showing that you have a license - it just reports that your trial expired. Is the license registered to another email address? Please can let us know so we can update our records and provide support.

    Colin

  • ajungajung Posts: 14Questions: 5Answers: 0

    The trial is registered to info@zopyx.com

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Hi,

    Many thanks. Are you able to give me a link to the page so I can take a look and work out what is going wrong please? Unfortunately the trial code is obfuscated, so the error message at the moment doesn't tell me much.

    table: '#myTable',

    Is that your table element's ID? An error can be thrown if the id doesn't exist on the page.

    Allan

  • ajungajung Posts: 14Questions: 5Answers: 0

    Unfortunatly, this is no public. The datatables renders nicely, the editor renders nicely...

  • ajungajung Posts: 14Questions: 5Answers: 0

    C4n is assigned to "ajax".

  • ajungajung Posts: 14Questions: 5Answers: 0

    Found it: I've been loading jQuery SLIM rather than the full jQuery module...works now...sorry for the noise.

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Ah! Yes, I wouldn't have guessed that.

    Good to hear you found the issue.

    Allan

Sign In or Register to comment.