Ayesha Fathima

Ayesha Fathima

  • NA
  • 184
  • 29.9k

Failed to execute 'insertBefore' on 'Node': datatable

Feb 22 2018 10:58 PM
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
  1. <div class="panel panel-primary" id="inboxdetailsgroupbox">  
  2.                <div class="panel-heading">  
  3.                   <h4 class="panel-title">Inbox Details</h4>  
  4.                </div>  
  5.                <div class="panel-body">  
  6.                  <table id="Getmaildetailstable" class="table table-striped display" width="100%" >  
  7.                      <thead>  
  8.                         <tr>  
  9.                            <th><input name="select_all" value="1" type="checkbox"></th>  
  10.                            <th>Starredflag</th>  
  11.                            <th>Importantflag</th>  
  12.                            <th>Mailid</th>  
  13.                            <th>Mailbox</th>  
  14.                            <th>LogicalID</th>  
  15.                            <th>Starred</th>  
  16.                            <th>Important</th>  
  17.                            <th>Subject</th>  
  18.                            <th>attachments</th>  
  19.                            <th>mailsize</th>  
  20.                            <th>Created On</th>  
  21.                            <th>Received On</th>  
  22.                            <th>From</th>  
  23.                            <th>To</th>  
  24.                            <th>Incident_no</th>  
  25.                            <th>classification</th>  
  26.                            <th>Attachments</th>  
  27.                         </tr>  
  28.                      </thead>  
  29.                   </table>  
  30.                </div>                                      
  31.             </div>   
  32.               
  1. function getmailsdata()  
  2.          {  
  3.                     $.cordys.ajax({  
  4.                     method: "Getclassifiedmails",  
  5.                     namespace: "http://schemas.cordys.com/IMSPackage",  
  6.                     parameters: {  
  7.                         emailbox:$("#inp_mailbox").val(),  
  8.                         emailid:'',  
  9.                         classification:$("#classifiedtype").val(),  
  10.                         incidentno:'',  
  11.                         subject:'',  
  12.                         fromdate:'',  
  13.                         todate:'',  
  14.                         body_content:''  
  15.                     },  
  16.                     dataType: '* json',  
  17.                      success: function (result) {   
  18.                      if (Getmaildetailstable != null) {  
  19.                         Getmaildetailstable.destroy();  
  20.                     }  
  21.                     Getmaildetailstable = $('#Getmaildetailstable').DataTable({  
  22.                            "retrieve"true,     
  23.                             "data": ((result.tuple == undefined) ? [] : ((result.tuple.length == undefined) ? [result.tuple] : result.tuple)),  
  24.                             "columns": [{  
  25.                                     className: 'dt-body-center',  
  26.                                     'render'function (data, type, full, meta){  
  27.                                       return '<input type="checkbox">';  
  28.                                      },  
  29.                                     "targets": 0,  
  30.                                 }, {  
  31.                                     "targets": 1,  
  32.                                     "data""old.EMAIL.STARRED_FLAG",  
  33.                                     visible: false,  
  34.                                 }, {  
  35.                                     "targets": 2,  
  36.                                     "data""old.EMAIL.IMPORTANT_FLAG",  
  37.                                     visible: false,  
  38.                                 }, {  
  39.                                     "targets": 3,  
  40.                                     "data""old.EMAIL.EMAIL_ID",  
  41.                                     visible: false,  
  42.                                 }, {  
  43.                                     "targets": 4,  
  44.                                     "data""old.EMAIL.EMAILBOX",  
  45.                                     visible: false,  
  46.                                 }, {  
  47.                                     "targets": 5,  
  48.                                     "data""old.EMAIL.LOGICAL_ID",  
  49.                                     visible: false,  
  50.                                 }, {  
  51.                                     "targets": 6,  
  52.                                      defaultContent: "",  
  53.                                     "data""image",render: getStarredflag,  
  54.                                     visible: true,  
  55.                                 }, {  
  56.                                     "targets": 7,  
  57.                                      defaultContent: "",  
  58.                                     "data""image",render: getImportantflag,  
  59.                                     visible: true,  
  60.                                 }, {  
  61.                                     "targets": 8,  
  62.                                     "data""old.EMAIL.SUBJECT",  
  63.                                     visible: true,  
  64.                                 }, {  
  65.                                     "targets": 9,  
  66.                                     "data""old.EMAIL.attachments",  
  67.                                     visible: false,  
  68.                                 }, {  
  69.                                     "targets": 10,  
  70.                                     "data""old.EMAIL.MAIL_SIZE",  
  71.                                     visible: false,  
  72.                                 }, {  
  73.                                     "targets": 11,  
  74.                                     "data""old.EMAIL.CREATE_DATE",  
  75.                                     visible: true,  
  76.                                 }, {  
  77.                                     "targets": 12,  
  78.                                     "data""old.EMAIL.RECEIVE_DATE",  
  79.                                     visible: false,  
  80.                                 }, {  
  81.                                     "targets": 13,  
  82.                                     "data""old.EMAIL.FROM_ADDRESS",  
  83.                                     visible: true,  
  84.                                 },  {  
  85.                                     "targets": 14,  
  86.                                     "data""old.EMAIL.TO_ADDRESS",  
  87.                                     visible: true,  
  88.                                 }, {  
  89.                                     "targets": 15,  
  90.                                     "data""old.EMAIL.INCIDENT_NO",  
  91.                                     visible: false,  
  92.                                 }, {  
  93.                                     "targets": 16,  
  94.                                     "data""old.EMAIL.CLASSIFICATION_TYPE",  
  95.                                     visible: false,  
  96.                                 }, {  
  97.                                     "targets": 17,  
  98.                                     "data""image",render: getImg,  
  99.                                     visible: true,  
  100.                                 }  
  101.                                 ]  
  102.                         });  
  103.                     },  
  104.                     async:false,  
  105.                     error: function(err){  
  106.                         console.log(err);  
  107.                     },  
  108.                      order: [  
  109.                      [4, 'asc']  
  110.                  ],  
  111.                     });  
  112.                     }  
  113.                       
  114.                       
  115.               

Answers (6)