PDA

View Full Version : MessageBox problem, see image?



JavascriptParrot
29 Aug 2012, 5:34 AM
Hello,

I'm just started with Ext Js, now I create an App and show a simple message in a box but the message isn't visible and the layout of the message box is strange.
38329

Anybody know to how to fix?

Thanks!

scottmartin
29 Aug 2012, 9:29 AM
How and when are you calling this MessageBox. There is obviously a mistake in your code, but we have no way of checking.

Scott.

JavascriptParrot
29 Aug 2012, 10:12 PM
Hello,

Thank you for the reply, I want to show the messagebox on the panel show event.



onPanelShow: function(abstractcomponent, options) {
Ext.MessageBox.alert('Status', 'Changes saved successfully.');
}

Thanks!

scottmartin
29 Aug 2012, 10:28 PM
It would be much better to load a notification window (non halting). Please see the following:
http://www.sencha.com/forum/showthread.php?145503

I would also use boxReady event instead of show.

Scott.

JavascriptParrot
30 Aug 2012, 4:56 AM
I looks nice but I need a blocking messagebox. I'ts strange that it isn't showing up.
Anybody knows the trick?

Thanks

scottmartin
30 Aug 2012, 6:12 AM
I do not know how your code is setup .. this should work:



Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'north',
html: '<h1 class="x-panel-header">Page Title</h1>',
border: false,
margins: '0 0 5 0'
}, {
region: 'west',
collapsible: true,
title: 'Navigation',
width: 150
}, {
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title
activeTab: 0, // First tab active by default
items: {
title: 'Default Tab',
html: 'The first tab\'s content. Others may be added dynamically'
},
listeners: {
boxready: function() {
Ext.MessageBox.alert('Status', 'Changes saved successfully.');
}
}
}]
});‚Äč


Scott.