TypeError: c is undefined while saving a new entry using New Entry Form in DataTable

TypeError: c is undefined while saving a new entry using New Entry Form in DataTable

NirmalaSudhirRajNirmalaSudhirRaj Posts: 2Questions: 0Answers: 0

I have this table that displays a bootstrap modal with a form inside, when i fill this form and save my data or clicking to close modal, i want to refresh the data table but this caught and error:

 TypeError: c is undefined 

 ...dErrors";g[w0]("postSubmit",[c,n,j]);if(!c.error)c.error="";if(!c[(j4a+R6a+K8+i1...

on line 296 in dataTables.editor.min.js

this show this error when i refresh the ajax data, this is my code:

var editor;
var oTable;
function getStudentdetails(id) {
    editor = new $.fn.dataTable.Editor({  
       dom: "Tfrtip",
       table: "#table_student_details",   
       fields: [ {
              label: "Id:",
              name: "id",
              attr:  {
                 maxlength: 50,
                 name:"id",
                 placeholder: 'ID'
                    }
              }, {
            label: "Name:",
            name: "name"
            }
          ], 
         ajaxUrl: {
             "create":  "/addStudentdetails",
              "edit":   "/editStudentdetails",
              "remove": "/deleteStudentdetails"
               },

        });

   oTable = $('#table_student_details').DataTable({
       dom: "Tfrtip",
       destroy: true,
       ajax: {
           "url": url_prefix + "/getStudentDetails",
           "data": function(d) {
                d.id = id;
            }
         },
       tableTools: {
          sRowSelect: "os",
          aButtons: [{
            sExtends: "editor_create",
            editor: editor
            }, {
            sExtends: "editor_edit",
            editor: editor
            }, {
            sExtends: "editor_remove",
            editor: editor
          }]
     }
 });
}

I use the Files and versions and also in the below order:

    jquery-1.11.1.min.js
    jquery.dataTables.min.js-> 1.10.2
    dataTables.bootstrap.js
    dataTables.tableTools.min.js-->2.2.2
    dataTables.editor.min.js ->1.3.2

Somebody help me pls. I m struck with this for 5 days.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Hi,

    Thanks for your question. I don't appear to have a record of an Editor license (trial or purchased) for your account. Could you confirm which account you purchased the license under so I can update my records and ensure you get the appropriate level of support?

    Thanks,
    Allan

  • NirmalaSudhirRajNirmalaSudhirRaj Posts: 2Questions: 0Answers: 0

    Hi allan,
    I used trail version(downloaded from your site) using my other gmail account nirmalachndrn@gmail.com. Please Help me as soon as possible.

    Thanks.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Thanks for the update and letting me know. It looks like your trial has just expired and Editor code will stop working soon, if it hasn't already. I've just extended your trial and you can download the updated trial again if you would like to continue trying out Editor.

    Regarding the problem detailed above, are you able to link to the page so I can take a look and see what the problem might be? Alternatively, what is the Ajax return from the server when you perform an edit? Are you following the Editor client / server communication protocol?

    I don't immediately see a problem with the code above, so I think I might need a link to help resolve the issue.

    Thanks,
    Allan

  • NirmalaSudhirrNirmalaSudhirr Posts: 7Questions: 3Answers: 0
    edited September 2014

    Hi allan

    I cant link you to the page where i work. But i included my Js files in Js fiddle External Resource. I hope it will help u. http://jsfiddle.net/Lujjz9ag/1/

    I worked as per what explained in the link http://editor.datatables.net/examples/simple/simple.html. One more thing I can able to add/edit the details from the editor form and see the updated result in my database. But only thing is I cant able to close the form window after submitting the data, When I click create(in Create New entry form) and Update button (in Edit Form) I get the Error and Its(I mean the form) is still open. I wan to close it as soon as i click the button(I mean after sending datas to my database). Thanks for all your reply

  • NirmalaSudhirrNirmalaSudhirr Posts: 7Questions: 3Answers: 0

    Hi again allan,
    I used your editor1.3.3 as you told, stil i get the same error :( Pls Help me as soon as possible.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Unfortunately the JSFiddle doesn't really help in this case, since you note that the error occurs when you try to edit an item, and obviously I can't edit anything in your JSFiddle.

    As I asked, what is the server responding with on the edit submit? Have you fully implemented the client / server protocol I linked to before?

    Allan

  • NirmalaSudhirrNirmalaSudhirr Posts: 7Questions: 3Answers: 0
    edited September 2014

    allan

    I implemented client server protocol as you linked. Here the edit submit response

      {'data[id]': '1', 'data[name]': 'nirmala', 'action': 'edit', 'id': '1'}
    
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    As the documentation notes there is no data property in the Editor server return. There are examples at the bottom of the page.

    Also, the above is not valid JSON.

    Allan

  • NirmalaSudhirrNirmalaSudhirr Posts: 7Questions: 3Answers: 0
    edited September 2014

    allan

    I m sorry .I dont get you. "what is the server responding with on the edit submit? "
    I thought you asked what the edit submit in the edit form gives after clicking it.

    did you ask this

     {"aaData": [{"id": 1, "name": "nirmala"}], "iTotalRecords": 1, "sEcho": 99, "iTotalDisplayRecords": 1}
    
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Ah I see - what is the server replying with, for that request that Editor is making? The is the data that is sent is it? What is the server returning?

    Allan

This discussion has been closed.