Ê×Ò³ Ê«´Ê ×Öµä °å±¨ ¾ä×Ó ÃûÑÔ ÓÑ´ð ÀøÖ¾ ѧУ ÍøÕ¾µØͼ
µ±Ç°Î»ÖÃ: Ê×Ò³ > ½Ì³ÌƵµÀ > ÍøÕ¾¿ª·¢ > WebÇ°¶Ë >

EXTѧϰ֮·-ʵս´°¿Ú¸ú¶Ô»°¿ò

2012-10-28 
EXTѧϰ֮·----ʵս´°¿ÚºÍ¶Ô»°¿ò°üº¬Ïà¹Øwindow ºÍ alert£¬confirm ,prompt»¹ÓÐ×Ô¶¨ÒåµÄÌáʾ¿òvar i 0v

EXTѧϰ֮·----ʵս´°¿ÚºÍ¶Ô»°¿ò
°üº¬Ïà¹Øwindow ºÍ alert£¬confirm ,prompt»¹ÓÐ×Ô¶¨ÒåµÄÌáʾ¿ò

var i = 0;
var myGroup;
function newWin()
{
var win = new Ext.Window(
        {
            title:'´°¿Ú'+i++,
            width:400,
            height:300,
            maximizable:true,
            manager:myGroup
        }
        );
       
        win.show();
}

function toBack()
{
    myGroup.sendToBack(myGroup.getActive());
}

function hideAll()
{
    myGroup.hideAll();
}

function save(button)
{
    if (button == "yes")
    {
        Ext.Msg.alert("±£´æ");
    }
   
}

Ext.onReady(function(){
    myGroup = new Ext.WindowGroup();
    Ext.get("btn").on("click", newWin);
    Ext.get("btnToBack").on("click",toBack);
    Ext.get("btnHide").on("click",hideAll);
    //È·ÈÏ¿ò
    Ext.get("he").on("click",function(){
   
        Ext.Msg.confirm("ÇëÈ·ÈÏ","ÕæµÄҪɾ³ýÂð",function(button,text){
            if (button=="yes")
            {
                Ext.Msg.alert("OK","ɾ³ý³É¹¦");
            }
        });
    });
    //ÊäÈë¿ò
    Ext.get("prompt").on("click",function(){
       
        Ext.Msg.prompt("ÊäÈë¿ò","ÇëÊäÈëÄãµÄ¸ñÑÔ",function(button,text){
            if (button =="ok")
            {
                Ext.Msg.alert("OK","ÄãµÄ¸ñÑÔΪ:"+text);
            }
        });
    });
    //×Ô¶¨Òå¶Ô»°¿ò
    Ext.get("diyDialog").on("click",function(){
       
        Ext.Msg.show({title:'±£´æÊý¾Ý',msg:'ÄãÒÑÐÞ¸ÄÁËÎļþ£¬ÊÇ·ñ±£´æ?',buttons:Ext.Msg.YESNOCANCEL,fn:save,icon:Ext.Msg.QUESTION});
    });
   
});



ÈȵãÅÅÐÐ