1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    3
    Vote Rating
    0
    Learn is on a distinguished road

      0  

    Question Answered: Aligning buttons in messagebox

    Answered: Aligning buttons in messagebox


    Hi,

    I need to align the OK button of the message box to the right. I am using the Ext.MessageBox class to display my messagebox. I have tried using buttonAlign but that doesnt work. Also tried to create a custom button and attach a class to it but this button is not being displayed. Any ideas please?

    Ext.MessageBox.show({
    title: 'Error',
    msg: "This is a message", //getting the value
    buttonAlign:'right', //doesnt work
    buttons: Ext.MessageBox.OK,
    icon: infoType
    });

  2. You can update the layout of the toolbar the buttons live in. Right now it has pack : 'center'

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You can update the layout of the toolbar the buttons live in. Right now it has pack : 'center'
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    3
    Vote Rating
    0
    Learn is on a distinguished road

      0  

    Default


    Hi,

    Thanks a lot for the help. I am very new to extjs. Could you please direct me to the js file which would have this. Thanks again.

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    The MessageBox source is in the src/window/MessageBox.js file.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    3
    Vote Rating
    0
    Learn is on a distinguished road

      0  

    Default


    Made a change to this part of MessageBox.js file. Thanks again.

    getDialog : function(titleText){
    if(!dlg){
    var btns = [];

    buttons = {};
    Ext.each(buttonNames, function(name){
    btns.push(buttons[name] = new Ext.Button({
    text: this.buttonText[name],
    handler: handleButton.createCallback(name),
    hideMode: 'offsets'
    }));
    }, this);
    dlg = new Ext.Window({
    autoCreate : true,
    title:titleText,
    buttonAlign:"right",

  7. #6
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    22
    Vote Rating
    1
    Answers
    1
    nirvdrum is on a distinguished road

      0  

    Default


    If you have a moment, an example that doesn't require modifying the ExtJS source would be much appreciated. I tried a few approaches to building up my own toolbar in Ext.MessageBox.show, but I'm fairly new to the object model and am clearly missing something.

    FWIW, "buttonAlign" seems like it'd be a great option if it worked. I see it's no longer even in the ExtJS 4.1.3 source, although it still appears in the documentation.