夢幻之旅

          DEBUG - 天道酬勤

             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            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 : '任務進度報表',
                                              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 閱讀(312) 評論(0)  編輯  收藏 所屬分類: EXT
          主站蜘蛛池模板: 灵寿县| 思茅市| 犍为县| 九江县| 云梦县| 甘肃省| 楚雄市| 家居| 郓城县| 阳泉市| 昭平县| 梓潼县| 宜兰县| 赤峰市| 五华县| 贵南县| 克拉玛依市| 兴安县| 彰化县| 姚安县| 隆子县| 岳普湖县| 忻州市| 南皮县| 拉孜县| 武穴市| 清苑县| 延庆县| 万州区| 滦南县| 常宁市| 车致| 古丈县| 勃利县| 墨江| 灵璧县| 乌苏市| 中超| 滕州市| 治县。| 乐山市|