Results 1 to 5 of 5

Thread: Ext.MessageBox?getDialog?override??

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2009
    Location
    Tokyo Japan
    Posts
    29
    Vote Rating
    0
      0  

    Default Ext.MessageBox?getDialog?override??

    ?????????
    ????????Ext.Window?backspace?????????????????????Ext.Window???????????????
    http://extjs.com/forum/showthread.php?t=65258

    ??????Ext.MessageBox???????????????
    ?????????????
    function dialogHistoryControl(){
    if(Ext.isIE6){ // IE6????
    var ifr = Ext.select('.ext-shim').item(0).dom.contentWindow;
    ifr.document.onkeydown = function(e){
    if(ifr.event.keyCode==8) return false;
    };
    }
    }
    ?????????????????????????
    var msgDialog = Ext.Msg.show({
    ???????
    });
    dialogHistoryControl();

    ????Ext.Msg.show??????????????????????????????????
    ?????????Ext.MessageBox?getDialog??????????????????override????????return????????????????override?????????
    return {??ext-all.js???????????????
    getDialog : function(titleText){
    if(!dlg){
    dlg = new Ext.Window({
    autoCreate : true,
    title:titleText,
    resizable:false,
    constrain:true,
    constrainHeader:true,
    minimizable : false,
    maximizable : false,
    stateful: false,
    modal: true,
    shim:true,
    buttonAlign:"center",
    width:400,
    height:100,
    minHeight: 80,
    plain:true,
    footer:true,
    closable:true,
    close : function(){
    if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
    handleButton("no");
    }else{
    handleButton("cancel");
    }
    }
    });
    buttons = {};
    var bt = this.buttonText;

    buttons["ok"] = dlg.addButton(bt["ok"], handleButton.createCallback("ok"));
    buttons["yes"] = dlg.addButton(bt["yes"], handleButton.createCallback("yes"));
    buttons["no"] = dlg.addButton(bt["no"], handleButton.createCallback("no"));
    buttons["cancel"] = dlg.addButton(bt["cancel"], handleButton.createCallback("cancel"));
    buttons["ok"].hideMode = buttons["yes"].hideMode = buttons["no"].hideMode = buttons["cancel"].hideMode = 'offsets';
    dlg.render(document.body);
    dlg.getEl().addClass('x-window-dlg');
    mask = dlg.mask;
    bodyEl = dlg.body.createChild({
    html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'
    });
    iconEl = Ext.get(bodyEl.dom.firstChild);
    var contentEl = bodyEl.dom.childNodes[1];
    msgEl = Ext.get(contentEl.firstChild);
    textboxEl = Ext.get(contentEl.childNodes[2].firstChild);
    textboxEl.enableDisplayMode();
    textboxEl.addKeyListener([10,13], function(){
    if(dlg.isVisible() && opt && opt.buttons){
    if(opt.buttons.ok){
    handleButton("ok");
    }else if(opt.buttons.yes){
    handleButton("yes");
    }
    }
    });
    textareaEl = Ext.get(contentEl.childNodes[2].childNodes[1]);
    textareaEl.enableDisplayMode();
    progressBar = new Ext.ProgressBar({
    renderTo:bodyEl
    });
    bodyEl.createChild({cls:'x-clear'});
    }
    // ???3????
    setTimeout(function(){
    try{ dialogHistoryControl();}catch(e){}
    }, 50);

    return dlg;
    }
    };

    ???????override???????????????
    ??????????????????????????????
    ??????????????????????????????????
    ???????????

  2. #2
    Ext JS Premium Member
    Join Date
    Mar 2009
    Location
    Tokyo Japan
    Posts
    29
    Vote Rating
    0
      0  

    Default ????????

    ?????????????Ext.Msg.show??????????????????getDialog ??????????
    var msgDialog = Ext.Msg.show({
    ???????
    });
    msgDialog.getDialog().setSize(???????;

    ?????getDialog???????????????
    ???????????

  3. #3
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Mari View Post
    ?????????Ext.MessageBox?getDialog??????????????????override????????return????????????????override?????????
    return?????????????????????Ext.MessageBox????????????????????????????override??????????

    Ext.override??override?????????prototype?????????????Ext.MessageBox?prototype???????????????????override?????getDialog?????????????????????????????????????????

    ????????????????MessageBox.js???????????????????????????????????????????????????ext-all.js??????????
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWT????????][????????????][Ext JS???????????????]

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2009
    Location
    Tokyo Japan
    Posts
    29
    Vote Rating
    0
      0  

    Red face ??????????

    ??????????????

    ??????????????2.1.0????MessageBox-min.js????????
    ???????????js????????????????????????

    ????????????
    ???????????????

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default

    ????????????????????????????????????????????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •