梦幻之旅

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 阅读(299) 评论(0)  编辑  收藏 所属分类: EXT

只有注册用户登录后才能发表评论。


网站导航: