Results 1 to 3 of 3

Thread: Ext.Msg box dynamic height and width

  1. #1
    Sencha User
    Join Date
    Jul 2018
    Posts
    2

    Default Ext.Msg box dynamic height and width

    I have a message box that I create like so:

    Code:
    Ext.Msg.show({
    title:'title',
    msg:'some message',
    buttons:Ext.Msg.OKCANCEL,
    icon:Ext.Msg.WARNING
    });
    The message content is of variable length and sometimes it breaks into two lines. My requirement is to get the message into a single line so I hard-coded a width for the message box like so:
    Code:
    Ext.Msg.show({
    title:'title',
    msg:'some message',
    buttons:Ext.Msg.OKCANCEL,
    icon:Ext.Msg.WARNING,
    minWidth:900,
    width:900
    });
    This increased the width of the box and my message could now fit into a single line for most cases which is sufficient for my requirements. However, this introduced a new problem.

    gridx.png


    As you can see, there is now an empty space that gets added to the bottom of the box. This space increases with each new entry if it is greater than a certain length ( I think this length is the original width calculated for the box by the framework).


    What I think is happening is, the framework initially calculates a height and a width based on the data provided. But then the width gets overridden by the new value I set, increasing the horizontal length of the box. But as the height never gets adjusted accordingly, it is left at its initially calculated value, resulting in the above behavior.


    Some help to sort this out would be highly appreciated! Thanks.

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Hello- I have sent your question over to a team member that can assist. Thanks for your patience!

  3. #3
    Sencha Staff
    Join Date
    Sep 2017
    Posts
    126
    Answers
    1

    Default

    Hello,

    You can set a maxHeight config on Message Box to give a maximum height.

    Regards,
    Pavan.

    Sencha Support.

Similar Threads

  1. Dynamic height and width for an Ext.Msg window
    By force45 in forum Ext: Q&A
    Replies: 1
    Last Post: 8 Sep 2018, 8:02 AM
  2. Replies: 3
    Last Post: 4 Feb 2016, 9:50 AM
  3. Scrollable container in overlay with dynamic width/height
    By jonhobbs in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 6 Apr 2012, 9:25 AM
  4. Dynamic CSS: Height and Width issues
    By arthurakay in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Jan 2009, 10:19 AM

Tags for this Thread

Posting Permissions

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