PDA

View Full Version : Ext.Msg box dynamic height and width



force45
13 Aug 2018, 9:22 AM
I have a message box that I create like so:


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:



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.

57664


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.

Forum_Adm
8 Sep 2018, 7:56 AM
Hello- I have sent your question over to a team member that can assist. Thanks for your patience!

pakumar
10 Sep 2018, 5:57 AM
Hello,

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

Regards,
Pavan.

Sencha Support.