PDA

View Full Version : Ext.ux.ConfirmWindow



tarini
29 May 2008, 2:35 AM
Hi guys, time to publish my little extension :)

I needed a custom-render confirmation message similar to Ext.MessageBox.confirm because I would have liked to render it (and being modal block user interactions) to a determinate container and not to my body.

So I created a custom Ext.Window (called ConfirmWindow) with this purpose.

Here's the code



Ext.namespace("Ext.ux");

Ext.ux.ConfirmWindow = Ext.extend(Ext.Window, {

yesIconCls: 'icon-yes',
noIconCls: 'icon-no',
yesText: 'Yes',
noText: 'No',

width: 250,
height: 100,
modal: true,

initComponent: function() {
this.bbar = ['->', {
handler: this.yesHandler,
scope: this,
iconCls: this.yesIconCls,
text: this.yesText
}, {
handler: this.noHandler,
scope: this,
iconCls: this.noIconCls,
text: this.noText
}];
this.items = new Ext.Panel({
html: this.message,
baseCls:'x-panel-mc',
bodyStyle: {paddingLeft: '5px', border: '0px'}
});
Ext.ux.ConfirmWindow.superclass.initComponent.call(this);
},

yesHandler: function() {
this.handler.call(this.scope);
this.close();
},

noHandler: function() {
this.close();
}

});


example of usage


var confirmWindow = new Ext.ux.ConfirmWindow({
title: "my title",
message: "my message",
handler: function() { doSomething() },
scope:this
});
confirmWindow.render(myContainer.getEl());
confirmWindow.show();


I write this code trying to be most conventional to Ext standard

If you get some problems or ideas, post here a message :)

Fabyo
29 May 2008, 3:07 AM
Hi, you could post an example of using?

thank you very much

tarini
29 May 2008, 4:25 AM
Hi, you could post an example of using?

done B)

Fabyo
29 May 2008, 6:19 AM
Thanks


I was testing here and it was strange, the window does not appear on the screen, appears only to half of it

have some css implement get along?

http://extjs.com.br/erro.JPG

ajaxvador
29 May 2008, 6:48 AM
very nice =D>

Fabyo
29 May 2008, 10:35 AM
done B)

You could make an example of the same image attached?
with buttons and html, images,css

the incomodo sorry, and I thank you for the help

http://extjs.com/forum/attachment.php?attachmentid=7088&stc=1&thumb=1&d=1212057344

tarini
29 May 2008, 10:35 AM
Thanks
I was testing here and it was strange, the window does not appear on the screen, appears only to half of it

have some css implement get along?

Mumble muble... it's very strange... can you post your code?