夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
          SmsTaskProgressPanel = Ext.extend(Ext.Panel, {
                      count : 
          0,
                      taskId : 
          null,
                      extTask : 
          null,
                      progressBar : 
          null,
                      mobileTextField : 
          null,
                      taskNameTextField : 
          null,
                      constructor : 
          function(taskIdStr) {
                          
          this.taskId = taskIdStr;
                          
          this.taskNameTextField = new Ext.form.TextField({
                              plain : 
          true,
                              style : 'text
          -align:left;background:transparent;border:0px;color:green;'
                          }
          );
                          
          this.mobileTextField = new Ext.form.TextField({
                              plain : 
          true,
                              value : '
          13816360376',
                              style : 'text
          -align:right;background:transparent;border:0px;color:green;'
                          }
          );
                          
          this.progressBar = new Ext.ProgressBar({
                                      width : 
          290
                                  }
          );
                          
          this.extTask = {
                              run : 
          function() {
                                  
          this.count = this.count + 1;
                                  
          if (this.count > 100{
                                      
          this.count = 0;
                                  }

                                  
          var percentage = Math.round(this.count) / 100;
                                  
          this.progressBar.updateProgress(percentage, (percentage * 100).toFixed(3)+ "%");
                                  
          this.mobileTextField.setValue('135+ (Math.floor(Math.random() * 10000000+ 10000000));
                              }
          ,
                              scope : 
          this,
                              interval : 
          100
                          }
          ;
                          SmsTaskProgressPanel.superclass.constructor.call(
          this{
                                      width : 
          290,
                                      height : 
          67,
                                      border : 
          false,
                                      items : [
          this.progressBar],
                                      tbar : [
          this.taskNameTextField],
                                      bbar : ['
          ->', this.mobileTextField]
                                  }
          );
                          
          this.start();
                      }
          ,
                      start : 
          function() {
                          Ext.TaskMgr.start(
          this.extTask);
                      }
          ,
                      stop : 
          function() {
                          Ext.TaskMgr.stop(
          this.extTask);
                      }

                  }
          );
                  
                  SmsTaskProgressWin 
          = Ext.extend(Ext.Window, {
                              constructor : 
          function() {
                                  SmsTaskProgressWin.superclass.constructor.call(
          this{
                                              title : '任務(wù)進度報表',
                                              width : 
          300,
                                              height : 
          432,
                                              resizable : 
          false,
                                              draggable : 
          true,
                                              layout : 'form',
                                              border : 
          false,
                                              buttonAlign : 'center'
                                          }
          );
                              }
          ,
                              close : 
          function()
                              
          {
                                  
          for(var i=0;i<this.items.length;i++)
                                  
          {
                                     
          this.items.itemAt(i).stop();
                                  }

                                  
          this.removeAll();
                                  
          this.hide();
                              }
          ,
                              openWindow : 
          function(ids) {
                                  
          var ids = '1,2,3,4,5,6';
                                  
          var aIds = ids.split(",");
                                  
          for (var i = 0; i < aIds.length; i++{
                                      
          this.add(new SmsTaskProgressPanel(''));
                                  }

                                  
          this.setWinHeight();
                                  
          this.show();
                              }
          ,
                              setWinHeight : 
          function()
                              
          {
                                  
          this.setHeight(28 + this.items.length*67);
                              }

                          }
          );
          posted on 2011-01-03 15:09 HUIKK 閱讀(311) 評論(0)  編輯  收藏 所屬分類: EXT
          主站蜘蛛池模板: 富宁县| 卓尼县| 通渭县| 勐海县| 米易县| 肥西县| 务川| 上虞市| 丰镇市| 玉山县| 汾西县| 东乡县| 兴国县| 濮阳县| 武平县| 鄂托克旗| 南阳市| 正阳县| 普陀区| 吴桥县| 黄大仙区| 天等县| 米易县| 广平县| 黎城县| 娱乐| 博罗县| 安福县| 沙雅县| 内黄县| 秦安县| 潜江市| 安西县| 张家口市| 会同县| 克东县| 永新县| 阳新县| 株洲县| 淅川县| 栾川县|