1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    2
    Vote Rating
    0
    rhedgpeth is on a distinguished road

      0  

    Default Ext.MesasgeBox.buttonText in-line width set and cannot be changed after - IE7 Only

    Ext.MesasgeBox.buttonText in-line width set and cannot be changed after - IE7 Only


    This is for 2.2.1

    I am changing the value of Ext.MessageBox.buttonText.ok to 'Confirm', which displays perfectly the first time the message box is shown. However, due to some needed logic I am changing Ext.MessageBox.buttonText.ok to 'OK', and once I do this an in-line style width of 20px is applied to the <SPAN> surrounding the button's text and cannot be removed. Meaning that if I set Ext.MessageBox.buttonText back to 'Confirm' only 'Cor' is displayed in the button. This only happens in IE7. Has anyone encountered this before?

    Code:
    function displayAlertMsg(msgText, msg)
    {
     Ext.MessageBox.buttonText.ok = msg;
     
     Ext.MessageBox.show({
                    title : 'Alert',
                    msg : msgText,
                    buttons: Ext.MessageBox.OK,
                    icon: Ext.MessageBox.WARNING
       });
     return;
    }
    You can test this function in IE7 by toggling between the following two function calls...

    Code:
    displayAlertMsg('This is a test message!', 'Confirm');
     
    displayAlertMsg('This is a test message!', 'OK');
    Thank you in advance for any advice on solving this!

  2. #2
    Sencha User
    Join Date
    Mar 2009
    Posts
    6
    Vote Rating
    0
    keith204 is on a distinguished road

      0  

    Default


    I found a solution, and if there is a more elegant solution out there let me know.

    The problem is that this.btnEl is undefind in Ext.Button.autoWidth(). The workaround is in red.

    Code:
    Ext.override( Ext.Button, {
      autoWidth:function() {
        if(this.el){
          this.el.setWidth("auto");
          if(Ext.isIE7 && Ext.isStrict){
            var ib = this.btnEl || this.el;
            
            if(ib && ib.getWidth() > 20){
              ib.clip();
              ib.setWidth(Ext.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));
            }
          }
          if(this.minWidth){
            if(this.el.getWidth() < this.minWidth){
              this.el.setWidth(this.minWidth);
            }
          }
        }
      }
    });

Similar Threads

  1. updating select width on label content changed
    By hulek89 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 24 Jan 2011, 4:36 AM
  2. Tabs' width in a layout is not changed when the region width changes
    By maya in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 3 Jun 2008, 12:47 AM
  3. Ext2.0--How to use buttonText option in MessageBox
    By cprabha in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 20 Mar 2008, 12:41 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi