Ajax (as an object) form submission breaks when create method unset

Ajax (as an object) form submission breaks when create method unset

chopstikchopstik Posts: 14Questions: 5Answers: 0
edited January 2015 in Bug reports
editor = new $.fn.dataTable.Editor( {
    ajax: {
    edit: '/dev/property/cake/admin/attachments/edit/_id_.json',
    remove: '/dev/property/cake/admin/attachments/delete/_id_.json'
  }, ...

results in... TypeError: opts.url is undefined on line 3243 (opts.url = opts.url.replace( /_id_/, id );) of dataTables.editor.js

...which seems to indicate line 3238 (opts = $.extend( {}, opts, ajaxSrc || {} );) is not correctly identifying the string url of the object. As soon as you add the create method in, it all falls into place and begins working without JS error.

editor = new $.fn.dataTable.Editor( {
  ajax: {
    create: '/dev/property/cake/admin/attachments/add.json',
    edit: '/dev/property/cake/admin/attachments/edit/_id_.json',
    remove: '/dev/property/cake/admin/attachments/delete/_id_.json'
  }, ...

Replies

This discussion has been closed.