Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    Russia
    Posts
    2
    Vote Rating
    0
    Compilerrr is on a distinguished road

      0  

    Default Unanswered: MessageBox buttons custom text

    Unanswered: MessageBox buttons custom text


    Maybe i'm doing something wrong but
    Code:
    Ext.MessageBox.buttonText = {
                ok     : "Alright",
                cancel : "Nooo",
                yes    : "Yeap",
                no     : "Noooo"
            };
    Ext.MessageBox.confirm('bla-bla?', 'bla-bla-bla?', callback);
    doesn't work for me.

    For me solution is:
    Code:
    Ext.MessageBox.msgButtons.ok.text = 'OK';
    Ext.MessageBox.msgButtons.cancel.text = 'Отмена';
    Ext.MessageBox.msgButtons.yes.text = 'Да';
    Ext.MessageBox.msgButtons.no.text = 'Нет';
    Ext.MessageBox.confirm('bla-bla?', 'bla-bla-bla?', callback);
    Anyone has the same problem?

    P.S. Here http://docs.sencha.com/ext-js/4-0/#!...dow.MessageBox
    written that MessageBox is under window package but it is actually just Ext.MessageBox. Is this an error?

  2. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default


    Ext.MessageBox is a singleton instance of Ext.window.MessageBox. It's created when the Ext.window.MessagBox is loaded. If you want to use this instance and want to change its button labels, you should do as you did.
    Code:
    Ext.MessageBox.msgButtons.ok.text = 'OK';
    Ext.MessageBox.msgButtons.cancel.text = 'Отмена';
    Ext.MessageBox.msgButtons.yes.text = 'Да';
    Ext.MessageBox.msgButtons.no.text = 'Нет';
    Ext.MessageBox.confirm('bla-bla?', 'bla-bla-bla?', callback);
    If you want to change button labels for all instances of custom message box, you should do as follow:
    Code:
    Ext.window.MessageBox.prototype.buttonText = {
        ok     : "Alright",
        cancel : "Nooo",
        yes    : "Yeap",
        no     : "Noooo"
    };
    ...
    var msgBox = Ext.create('Ext.window.MessageBox');
    msgBox.confirm('bla-bla?', 'bla-bla-bla?', callback);
    If you want to change button labels of a specific instance of custom message box, you should do as follow:
    Code:
    var msgBox = Ext.create('Ext.window.MessageBox',{
        buttonText: {
            ok     : "Alright",
            cancel : "Nooo",
            yes    : "Yeap",
            no     : "Noooo"
        }
    });
    msgBox.confirm('bla-bla?', 'bla-bla-bla?', callback);

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Russia
    Posts
    2
    Vote Rating
    0
    Compilerrr is on a distinguished road

      0  

    Default


    Thank you for your answer.
    Solutions that I found on forum doesn't work.
    Maybe they do for earlier versions. So now we have it for 4.0

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    26
    Vote Rating
    1
    alile is on a distinguished road

      0  

    Default


    In 2.2 at least, this does not work. The buttons are directly attached to Ext.MessageBox, and i was not able to find a more direct way to set them than the below.

    Code:
    Ext.MessageBox.OK.text = "my OK content"
    so i set up an external strings object and iterated through it:

    Code:
    MessageBox: 
    {
    OK: 'OK', CANCEL: 'Cancel', YES: 'Yes', NO: 'NO'
    }, // above assigned to strings for(var i in strings) { Ext.MessageBox[i].text = strings[i]; }

Thread Participants: 2

Tags for this Thread