PDA

View Full Version : Error Dialog with Detail link



thedatawarehouse
10 Aug 2010, 9:47 PM
I want a dialog box with a link 'show' that will trigger perhaps an extjs function so I could manipulate the div to present the detail and change the link to 'hide' and do the opposite on click.

I am thinking of directly putting the div in the msg property of the dialog box.

Please help point me to the right direction, thanks.



Ext.Msg.show({
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
title : 'Request Error',
msg : respObj.errorDescShort + '<br><br><a href="somefunction()" class"dialoglink">Show Detail</a>'
});

thedatawarehouse
10 Aug 2010, 11:54 PM
something must be wrong in how i asked. I got 2 views only in 1 hour~ :((



doStandardError : function(respObj) {
Ext.Msg.show({
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
title : 'Request Error',
autoHeight : true,
autoWidth : true,
msg : respObj.errorDescShort
+ '<br><br><div id="errorSection"><a id="errorLink">Show Detail<a><div id="errorDetail"/></div>'
});

Ext.EventManager.on(Ext.get('errorLink'), 'click', function() {
if (Ext.get('errorLink').dom.innerHTML == 'Show Detail') {
Ext.get('errorLink').dom.innerHTML = 'Hide Detail';
Ext.get('errorDetail').update(respObj.errorDescLong);
} else {
Ext.get('errorLink').dom.innerHTML = 'Show Detail';
Ext.get('errorDetail').update('');
}
});