Guest User

Untitled

a guest
Jan 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. var columnsSpecification = [
  2. {
  3. type: 'text',
  4. bRegex: true,
  5. bSmart: true
  6. }, {
  7. type: 'text',
  8. bRegex: true,
  9. sWidth:"90px"}];
  10.  
  11.  
  12. $scope.dtOptions = DTOptionsBuilder.newOptions()
  13. .withBootstrap()
  14. .withOption('scrollX', '700%')
  15. .withOption('scrollY', height + 'px')
  16. .withOption('oLanguage', { "sEmptyTable": " " })
  17. .withOption('lengthMenu', [[-1, 1000, 100, 50, 25, 10], ['All', 1000, 100, 50, 25, 10]])
  18. .withOption('paging', false)
  19. .withOption('bInfo',false)
  20. .withColumnFilter({
  21. aoColumns:columnsSpecification
  22. })
  23. .withTableTools('/Content/DataTables/swf/copy_csv_xls.swf')
  24. .withTableToolsButtons(['xls']);
  25.  
  26. <table id="table-machines" datatable="ng" class="table table-striped" dt-options="dtOptions">
  27. <thead>
  28. <tr>
  29. <th>Name</th>
  30. <th style="width: 90px !important">Value</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. <tr ng-repeat="m in records>
  35. <td>{{m.name}}</td>
  36. <td style="width: 90px !important">{{m.Value}}</td>
  37. </tr>
  38. </tbody>
  39.  
  40. vm.dtColumns = [
  41. DTColumnBuilder.newColumn('id').withTitle('ID').withOption('width', '5%')
  42. ];
  43.  
  44. vm.dtColumnDefs = [
  45. DTColumnBuilder.newColumn(1).withOption('width', '90px')
  46. ];
  47.  
  48. $scope.dtOptions = DTOptionsBuilder.newOptions()
  49. .withOption('autoWidth', false)
Add Comment
Please, Sign In to add comment