JuanParraC
1 Dec 2006, 4:15 PM
Hi Jack, great work...
I'm new to the yui and yui-ext extension.
and I have a questions ...
In BasicDialog with one TabPanelItem a try to submit a simple form..
The server response a simple text, with this text i want to replace the TabPanelItem
Thanks
....
my code:
String.prototype.htmlDecode = function(){
var ret;
var sReplace = /\+/gi;
ret= unescape(this);
ret = ret.replace(sReplace, " ");
return(ret);
}
var fncSubmitFrm = function() {
var fncSuccess = function(o){
[list:3610349b2e]var data = o.responseText.htmlDecode();
// UPDATE dialog-tabItemPanel
// it works! but it is the way to do this?
var tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
getEl(tabEls[0].id).update(data,true);
var Tab = dialog.getTabs().getTab(tabEls[0].id);
// get new content
tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
// why tabEls[1] ?????
Tab.setText(tabEls[1].title);
tabEls[1].title='';
};
var fncFailure = function(o){
alert(o.responseText);
};
YAHOO.util.Connect.setForm(document.getElementById('form1'));
var frmAction = document.getElementById('form1').action;
YAHOO.util.Connect.asyncRequest('POST',frmAction,{success: fncSuccess , failure: fncFailure }); [/list:u:3610349b2e]
};
dialog = new YAHOO.ext.BasicDialog('ID',
{
modal:true,
autoTabs:true,
width:280,
height:180,
shadow:true,
minWidth:300,
minHeight:200,
closable:true
}
);
dialog.addButton('Submit', fncSubmitFrm );
I'm new to the yui and yui-ext extension.
and I have a questions ...
In BasicDialog with one TabPanelItem a try to submit a simple form..
The server response a simple text, with this text i want to replace the TabPanelItem
Thanks
....
my code:
String.prototype.htmlDecode = function(){
var ret;
var sReplace = /\+/gi;
ret= unescape(this);
ret = ret.replace(sReplace, " ");
return(ret);
}
var fncSubmitFrm = function() {
var fncSuccess = function(o){
[list:3610349b2e]var data = o.responseText.htmlDecode();
// UPDATE dialog-tabItemPanel
// it works! but it is the way to do this?
var tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
getEl(tabEls[0].id).update(data,true);
var Tab = dialog.getTabs().getTab(tabEls[0].id);
// get new content
tabEls = YAHOO.util.Dom.getElementsByClassName('ydlg-tab', 'div', dialog.el.dom);
// why tabEls[1] ?????
Tab.setText(tabEls[1].title);
tabEls[1].title='';
};
var fncFailure = function(o){
alert(o.responseText);
};
YAHOO.util.Connect.setForm(document.getElementById('form1'));
var frmAction = document.getElementById('form1').action;
YAHOO.util.Connect.asyncRequest('POST',frmAction,{success: fncSuccess , failure: fncFailure }); [/list:u:3610349b2e]
};
dialog = new YAHOO.ext.BasicDialog('ID',
{
modal:true,
autoTabs:true,
width:280,
height:180,
shadow:true,
minWidth:300,
minHeight:200,
closable:true
}
);
dialog.addButton('Submit', fncSubmitFrm );