Guest User

Untitled

a guest
Jun 19th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. slide = {
  2.  
  3. executiveList : [],
  4.  
  5. showScoreboard : true,
  6.  
  7. timeScoreBoard : 5000,
  8.  
  9. timeExecutive : 8000,
  10.  
  11. loop : true,
  12.  
  13. init : function(){
  14. this.getExecutiveList();
  15. this.start();
  16. },
  17.  
  18. start : function(){
  19. var _me = this
  20. var auxList = dojo.fromJson(this.executiveList);
  21.  
  22. //while( this.loop ){
  23.  
  24. dojo.forEach(auxList, function(executive, index, array) {
  25. console.log( executive.id );
  26. _me.showTable();
  27. //setTimeout( '_me.showExecutive('+executive.id+')', 5000);
  28. }
  29. );
  30.  
  31. //}
  32. },
  33.  
  34. stop :function(){
  35. this.loop = false;
  36. },
  37.  
  38. getExecutiveList : function(){
  39. var _me = this
  40.  
  41. dojo.xhrGet({
  42. sync : true,
  43. url: 'index/getexecutives',
  44. load: function(data){
  45. _me.executiveList = data;
  46. },
  47. error: function(err){
  48. console.debug("An error occurred: ", err);
  49. },
  50. timeout: 5000
  51. });
  52. },
  53.  
  54. showTable : function(){
  55. dojo.xhrGet({
  56. sync : true,
  57. url: 'index/showtable',
  58. load: function(data){
  59. dojo.byId("mainContent").innerHTML = data;
  60. },
  61. error: function(err){
  62. console.debug("An error occurred: ", err);
  63. },
  64. timeout: 5000
  65. });
  66. },
  67.  
  68. showExecutive : function(id){
  69. dojo.xhrPost({
  70. sync : true,
  71. url: 'index/showgraph',
  72. content: {exeId : id},
  73. load: function(data){
  74. dojo.byId("mainContent").innerHTML = data;
  75. },
  76. error: function(error){
  77. console.error('Error: ', error);
  78. },
  79. timeout: 5000
  80. });
  81. }
  82. }
Add Comment
Please, Sign In to add comment