Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <table data-role="table" id="table" data-mode="columntoggle" class="ui-body-d ui-shadow table-stripe ui-responsive" data-column-btn-theme="b" data-column-btn-text="Columns to display..." data-column-popup-theme="a">
  2. <thead>
  3. <tr class="ui-bar-d">
  4. <th data-priority="1">#</th>
  5. <th data-priority="1">Data Code</th>
  6. <th>Data Name</th>
  7. <th>Value</th>
  8. <th data-priority="1">Minimum</th>
  9. <th data-priority="1">Maximum</th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. ...
  14. </tbody>
  15. </table>
  16.  
  17. for (var i = 0; i < rows.length; i++) {
  18. html = html + "<tr>n";
  19. for (var j = 0; j < rows[i].length; j++) {
  20. html = html + "<td>" + rows[i][j] + "</td>n";
  21. }
  22. html = html + "</tr>nn";
  23. }
  24.  
  25. $("#table > tbody").append(html);
  26. $("#table").table("refresh");
  27.  
  28. $("#table > tbody").append(html);
  29. $("#table").table("refresh");
  30.  
  31. // Code to add
  32. var columnIndex = 0;
  33. $("#table-popup fieldset").find("input").each(function(){
  34. var sel = ":nth-child(" + (columnIndex + 1) + ")";
  35. $(this).jqmData("cells", $("#table").find("tr").children(sel));
  36. columnIndex++;
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement