Skip to main content
Hi,

I have a table like below

 

<table id="applyFilterTable" class="table table-bordered table-condensed table-responsive" cellspacing="0" width="100%" />

I have called the table to show jquery data table and it is working as long as i dont put data into it.

I am trying to add data in multiple ways see the code below.

function rebuildTable_applyFilterTable(data) {

console.log('inside table'+data[0].EID__c);

var dataset = [];

for(var i=0;i<data.length;i++){

var ds = [];

ds.SID = data[i].EID__c;

ds.Name = data[i].Name;

dataset.push(ds);

}

j$('[id$="applyFilterTable"]').DataTable({

//"data" : dataset,

"scrollY": "260px",

"scrollCollapse": true,

"paging": true,

"searching": true,

"ordering": true,

"info": true,

"dom": 'Bfrtip',

"destroy" : true,

"buttons": [

'copy',

{extend: 'csvHtml5',title: 'Criteria export'},

{extend: 'excelHtml5',title: 'Criteria export'},

{extend: 'pdfHtml5',title: 'Criteria export'},

'print'

],

"columns": [

{ title: "EID",data:dataset.EID},

{ title: "Name",data:dataset.Name}

]

} );

}

my data set variable has data in it.

​1)i tried data:dataset which is throwing me the following error.

DataTables warning: table id=applyFilterTable - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

2)if i add the above code of adding data along with title it is not at all showing and not even throwing any errors.

is there a way that my page will not fail. all i need is how to add data

 
답변 6개
  1. 2018년 3월 20일 오후 8:10
    Hi raj,

    I have more than 1k records. it range from <1k to 3k records. jquery data table will have its own pagination and it also helps with export. And they want to export all 3k records at once. if i use custom pagination it is not possible.
0/9000