PDA

View Full Version : How to make Ext.example.msg dialog box closable ?



vinuthamsr
16 May 2012, 5:45 PM
Hi,

We have Ext.example.msg which creates a dialog box 'You have clicked on button .. ' message and auto hides the box with certain delay. My requirement is to make that box closable.
Can anyone help me on this regard ?
Mainly used the following code for drawing dialog box:
function(){
var msgCt;


function createBox(t, s){
return '<div class="msg"><h3>' + t + '</h3><p>' + s + '</p></div>';
}
return {
msg : function(title, format){
if(!msgCt){
msgCt = Ext.core.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
}
var s = Ext.String.format.apply(String, Array.prototype.slice.call(arguments, 1));
var m = Ext.core.DomHelper.append(msgCt, createBox(title, s), true);
m.hide();
m.slideIn('t').ghost("t", { delay: 5000, remove: true});
}
}

mitchellsimoens
25 May 2012, 10:52 AM
MessageBox is just a Window but it's an already instantiated component. You may be able to add tools or you can just create your own window.