Guest User

Untitled

a guest
Feb 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. $scope.dtColumnsCal= [
  2. DTColumnBuilder.newColumn('name').withTitle('Name')
  3. .renderWith(function(data, type, full){
  4. return "<a class='row-edit'>" +"<u>"+data+ " <i>" + (full.isDefault ? "(default)" : "") + "</i>"+"</u>" +"</a>";}),
  5. DTColumnBuilder.newColumn('description').withTitle('Description'),
  6. DTColumnBuilder.newColumn('weekStartDay').withTitle('Starting Day of Week')
  7. .renderWith(function(data,type,full){
  8. if(full.weekStartDay==1){
  9. return "Sunday"
  10. }
  11. if(full.weekStartDay==2){
  12. return "Monday"
  13. }
  14. if(full.weekStartDay==3){
  15. return "Tuesday"
  16. }
  17. if(full.weekStartDay==4){
  18. return "Wednesday"
  19. }
  20. if(full.weekStartDay==5){
  21. return "Thursday"
  22. }
  23. if(full.weekStartDay==6){
  24. return "Friday"
  25. }
  26. if(full.weekStartDay==7){
  27. return "Saturday"
  28. }
  29. }),
  30. DTColumnBuilder.newColumn('workingDays').withTitle('M')
  31. .renderWith(function(data, type, full){
  32. return data.indexOf(2)!=-1 ? 'u2713': 'u2718';}
  33. ),
  34. DTColumnBuilder.newColumn('workingDays').withTitle('T')
  35. .renderWith(function(data, type, full){ return data.indexOf(3)!=-1 ? 'u2713' : 'u2718';}),
  36. DTColumnBuilder.newColumn('workingDays').withTitle('W')
  37. .renderWith(function(data, type, full){ return data.indexOf(4)!=-1 ? 'u2713' : 'u2718';}),
  38. DTColumnBuilder.newColumn('workingDays').withTitle('T')
  39. .renderWith(function(data, type, full){ return data.indexOf(5)!=-1 ? 'u2713' : 'u2718';}),
  40. DTColumnBuilder.newColumn('workingDays').withTitle('F')
  41. .renderWith(function(data, type, full){ return data.indexOf(6)!=-1 ? 'u2713' : 'u2718';}),
  42. DTColumnBuilder.newColumn('workingDays').withTitle('S')
  43. .renderWith(function(data, type, full){ return data.indexOf(7)!=-1 ? 'u2713' : 'u2718';}),
  44. DTColumnBuilder.newColumn('workingDays').withTitle('S')
  45. .renderWith(function(data, type, full){return data.indexOf(1)!=-1 ? 'u2713' : 'u2718';}),
  46. DTColumnBuilder.newColumn('').withTitle('Action').renderWith(function(data, type, full){
  47. return "<a class='row-def' ng-model='click' ng-hide='click'><i ></i> <u>Set Default</u> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"
  48. + "<a class='row-del'><i class='fa fa-trash-o'></i> Delete</a>";})
  49. ].map(function(value){return value.withOption('defaultContent', '')});
  50. $scope.dtInstanceCal={};
  51.  
  52. }]);
  53.  
  54. $scope.dtColumnsCal= [
  55. DTColumnBuilder.newColumn('name').withTitle('Name')
  56. .renderWith(function(data, type, full){
  57. return "<a class='row-edit'>" +"<u>"+data+ " <i>" + (full.isDefault ?"(default)": "") + "</i>"+"</u>" +"</a>";}),
  58. DTColumnBuilder.newColumn('description').withTitle('Description'),
  59. DTColumnBuilder.newColumn('weekStartDay').withTitle('Starting Day of Week')
  60. .renderWith(function(data,type,full){
  61. if(full.weekStartDay==1){
  62. return "Sunday"
  63. }
  64. if(full.weekStartDay==2){
  65. return "Monday"
  66. }
  67. if(full.weekStartDay==3){
  68. return "Tuesday"
  69. }
  70. if(full.weekStartDay==4){
  71. return "Wednesday"
  72. }
  73. if(full.weekStartDay==5){
  74. return "Thursday"
  75. }
  76. if(full.weekStartDay==6){
  77. return "Friday"
  78. }
  79. if(full.weekStartDay==7){
  80. return "Saturday"
  81. }
  82. }),
  83. DTColumnBuilder.newColumn('workingDays').withTitle('M')
  84. .renderWith(function(data, type,full){
  85. return data.indexOf(2)!=-1 ? "<span style='color:#27C24C';>"+'u2713'+"</span>":"<span style='color:#E48282;'>"+ 'u2718'+"</span>";}
  86. ),
  87. DTColumnBuilder.newColumn('workingDays').withTitle('T')
  88. .renderWith(function(data, type, full){ return data.indexOf(3)!=-1 ? "<span style='color:#27C24C;'>"+ 'u2713'+"</span>" :"<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  89. DTColumnBuilder.newColumn('workingDays').withTitle('W')
  90. .renderWith(function(data, type, full){ return data.indexOf(4)!=-1 ?"<span style='color:#27C24C';>"+'u2713'+"</span>" : "<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  91. DTColumnBuilder.newColumn('workingDays').withTitle('T')
  92. .renderWith(function(data, type, full){ return data.indexOf(5)!=-1 ?"<span style='color:#27C24C';>" +'u2713'+"</span>" : "<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  93. DTColumnBuilder.newColumn('workingDays').withTitle('F')
  94. .renderWith(function(data, type, full){ return data.indexOf(6)!=-1 ?"<span style='color:#27C24C;'>"+ 'u2713'+"</span>" : "<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  95. DTColumnBuilder.newColumn('workingDays').withTitle('S')
  96. .renderWith(function(data, type, full){ return data.indexOf(7)!=-1 ?"<span style='color:#27C24C;'>" +'u2713'+"</span>" : "<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  97. DTColumnBuilder.newColumn('workingDays').withTitle('S')
  98. .renderWith(function(data, type, full){return data.indexOf(1)!=-1 ? "<span style='color:#27C24C;'>"+'u2713'+"</span>" : "<span style='color:#E48282;'>"+ 'u2718'+"</span>";}),
  99. DTColumnBuilder.newColumn('').withTitle('Action').renderWith(function(data, type, full){
  100. return "<a class='row-def' ng-model='click' ng-hide='click'><i ></i> <u>Set Default</u> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>"
  101. + "<a class='row-del'><i class='fa fa-trash-o'></i> Delete</a>";})
  102. ].map(function(value){return value.withOption('defaultContent', '')});
  103. $scope.dtInstanceCal={};
  104.  
  105. }]);
Add Comment
Please, Sign In to add comment