table111.page(1).draw(true) is not working
hi,
it works in first case but not in second , pls tel me why
- <table id="example" class="display" style="width:100%">
- <thead>
- <tr>
- <th>Name</th>
- <th>Position</th>
- <th>Office</th>
- <th>Age</th>
- <th>Start date</th>
- <th>Salary</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Tiger Nixon</td>
- <td>System Architect</td>
- <td>Edinburgh</td>
- <td>61</td>
- <td>2011/04/25</td>
- <td>$320,800</td>
- </tr>
- </tbody>
- </table>
- // then in js file
- var table12 = $('#example').DataTable();
- table12.page(1).draw(true); // works
- // but in below case it does not
- <table id="tblReport1" class="display" style="width:100%"><thead></thead><tbody></tbody></table>
- // in js file
- var dd = [
- {
- "name": "Tiger Nixon",
- "position": "System Architect",
- "salary": "$3,120"
- }
- ];
- var table111 = $('#tblReport1').dataTable({
- "data": dd
- ,
- "columns": [
- { "data": "name" },
- { "data": "position" },
- { "data":"salary"}
- ]
- });
- table111.page(1).draw(true); // does not work