I created one data table and added data to it up this it is fine.But onchange of one control i need to take that control value and pass to "Getclassifiedmails" method,while doing this onchange event iam facing issue like "Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.".I searched in google,they told some solutions like "retrieve:true" etc.But nothing is working in my case.Can anyone please help me?Below is my code
< div class = "panel panel-primary" id = "inboxdetailsgroupbox" > < div class = "panel-heading" > < h4 class = "panel-title" > Inbox Details h4 > div > < div class = "panel-body" > < table id = "Getmaildetailstable" class = "table table-striped display" width = "100%" > < thead > < tr > < th > < input name = "select_all" value = "1" type = "checkbox" > th > < th > Starredflag th > < th > Importantflag th > < th > Mailid th > < th > Mailbox th > < th > LogicalID th > < th > Starred th > < th > Important th > < th > Subject th > < th > attachments th > < th > mailsize th > < th > Created On th > < th > Received On th > < th > From th > < th > To th > < th > Incident_no th > < th > classification th > < th > Attachments th > tr > thead > table > div > div >
function getmailsdata() { $.cordys.ajax({ method: "Getclassifiedmails" , namespace: "http://schemas.cordys.com/IMSPackage" , parameters: { emailbox:$("#inp_mailbox" ).val(), emailid:'' , classification:$("#classifiedtype" ).val(), incidentno:'' , subject:'' , fromdate:'' , todate:'' , body_content:'' }, dataType: '* json' , success: function (result) { if (Getmaildetailstable != null ) { Getmaildetailstable.destroy(); } Getmaildetailstable = $('#Getmaildetailstable' ).DataTable({ "retrieve" : true , "data" : ((result.tuple == undefined) ? [] : ((result.tuple.length == undefined) ? [result.tuple] : result.tuple)), "columns" : [{ className: 'dt-body-center' , 'render' : function (data, type, full, meta){ return ' ' ; }, "targets" : 0, }, { "targets" : 1, "data" : "old.EMAIL.STARRED_FLAG" , visible: false , }, { "targets" : 2, "data" : "old.EMAIL.IMPORTANT_FLAG" , visible: false , }, { "targets" : 3, "data" : "old.EMAIL.EMAIL_ID" , visible: false , }, { "targets" : 4, "data" : "old.EMAIL.EMAILBOX" , visible: false , }, { "targets" : 5, "data" : "old.EMAIL.LOGICAL_ID" , visible: false , }, { "targets" : 6, defaultContent: "" , "data" : "image" ,render: getStarredflag, visible: true , }, { "targets" : 7, defaultContent: "" , "data" : "image" ,render: getImportantflag, visible: true , }, { "targets" : 8, "data" : "old.EMAIL.SUBJECT" , visible: true , }, { "targets" : 9, "data" : "old.EMAIL.attachments" , visible: false , }, { "targets" : 10, "data" : "old.EMAIL.MAIL_SIZE" , visible: false , }, { "targets" : 11, "data" : "old.EMAIL.CREATE_DATE" , visible: true , }, { "targets" : 12, "data" : "old.EMAIL.RECEIVE_DATE" , visible: false , }, { "targets" : 13, "data" : "old.EMAIL.FROM_ADDRESS" , visible: true , }, { "targets" : 14, "data" : "old.EMAIL.TO_ADDRESS" , visible: true , }, { "targets" : 15, "data" : "old.EMAIL.INCIDENT_NO" , visible: false , }, { "targets" : 16, "data" : "old.EMAIL.CLASSIFICATION_TYPE" , visible: false , }, { "targets" : 17, "data" : "image" ,render: getImg, visible: true , } ] }); }, async:false , error: function (err){ console.log(err); }, order: [ [4, 'asc' ] ], }); }
Ayesha FathimaPosted Mar 4, 2019, 7:16 AM
Muthu KumarPosted Mar 4, 2019, 6:36 AM
https://stackoverflow.com/questions/40628667/datatables-error-when-using-destroy-failed-to-execute-insertbefore-on-node
You need to add
Muthu KumarPosted Mar 4, 2019, 6:34 AM
Please check below links,
https://datatables.net/forums/discussion/28081/how-to-update-table-when-dom-changes-destroy-init-crash
https://datatables.net/forums/discussion/38918/i-get-this-error-failed-to-execute-insertbefore-on-node-the-node-before-which-the-new-node-is
Sunil AcharyaPosted Feb 27, 2019, 4:26 AM
Ayesha FathimaPosted Feb 22, 2018, 11:12 PM
Rajneesh ChaubeyPosted Feb 22, 2018, 11:04 PM