cacharry
cacharry

Reputation: 115

add logo and panels to a messagebox in extjs

I am new in extjs and I am trying to create a customized alert using Extjs4 but I haven't been successful doing so, the main idea is basically to add the company logo on the left side of the window, and the icon of the type of message and the message text aligned to the right side of the window. I tried different approaches but is not working, I tried to create a new window and adding panels, I tried to customize a regular Ext.Msg.show adding items to its properties but they are never displayed, can anybody give me an idea how to get this done or what approach is the best? I've been 2 days trying but I can't make it work and I am running out of ideas. I am attaching the code I did now, many thanks!!:

 Ext.Msg.show({
                    title:title,
                    msg: msg,
                    height: 200,
                    width: 300,
                    layout: 'fit',
                    items: {
                        xtype: 'panel',                           
                        html: '<img src="http://localhost:8080/anylogo/companylogo.gif" />' 
                    },
                    buttons: Ext.Msg.OK,
                    icon: Ext.Msg.WARNING
                });

Upvotes: 0

Views: 1233

Answers (1)

katspaugh
katspaugh

Reputation: 17899

It's a matter of style. You can assign a CSS class to the message box via cls config:

Ext.Msg.show({
    cls: 'alignright-with-logo'
});

Upvotes: 1

Related Questions