View Full Version : adjust messagebox

30 Oct 2013, 10:35 AM
Hi. I want a window with warning icon, some text for that warning, some other text to describe what to input, and then some prompt to input. I used the code below:

icon: Ext.MessageBox.WARNING,
prompt: true,
buttons: Ext.Msg.OKCANCEL,
fn: btn_action

The thing is, because i have the icon, all the content of the window is pushed to the right, including the prompt box. But i dont want that. What i have in mind is to separate the warning from the rest of the content in the window. It is possible?
I'm using extjs 4.1.0.
Best regards.

1 Nov 2013, 5:15 AM
I would have to modify the layout .. it seems a container is created for each and and uses a hbox
layout to place them next to each other:

me.topContainer = new Ext.container.Container({
layout: 'hbox',
padding: 10,
style: {
overflow: 'hidden'
items: [
me.iconComponent = new Ext.Component({
width: me.iconWidth,
height: me.iconHeight
me.promptContainer = new Ext.container.Container({
flex: 1,
layout: 'anchor',
items: [
me.msg = new Ext.form.field.Display({
id: baseId + '-displayfield',
cls: me.baseCls + '-text'
me.textField = new Ext.form.field.Text({
id: baseId + '-textfield',
anchor: '100%',
enableKeyEvents: true,
listeners: {
keydown: me.onPromptKey,
scope: me
me.textArea = new Ext.form.field.TextArea({
id: baseId + '-textarea',
anchor: '100%',
height: 75

4 Nov 2013, 6:57 AM
Hi. Thanks for the response. I will try the fix as soon as i can. Now, i have another issue to solve first :)
I give you feedback after i try.