PDA

View Full Version : How to display Form Panel on Button click of the Ext.window



50120C1288
1 May 2011, 1:32 AM
Hi All,

Good afternoon. i am very new to this extjs and i am seeking ur help.

I have a window (poup ext window) with preview button.once the user click on preview button he has to see a another pop up with data entered in the first ext.window.




function showAdvancedSearchDialog(htmlData) {
var window = new Ext.Window({
title: "E-Form Template Creation",
width:650,
autoHeight: true,
html: htmlData,
y: 150,
listeners: {
beforeclose: function () {
searchVisible = false;
}
},
buttons: [
{
text: 'Preview', handler: function() {
displayPreview();
}
},
{
text:'Save', handler: function() {
window.close();
}
}
]
});

window.show(this);
}


and the second window code is like this.




function displayPreview()

{
var id =$("#eform_id").val();
alert("E-Form_ID-->"+id);
data = "eform_id=" + id;
alert(data);
$.ajax( {
type : "GET",
url : "/ajax/eform/Preview.do",
data : data,
cache : false,
dataType : "text/html",
timeout: 20000,
beforeSend : function() {
showWaitingDialog("Please wait...");
},
error: function (xhr, err)
{
resolveAjaxError(xhr, err);
},
success : function(data) {

showEformDialog(data);
}

});

}

function showEformDialog(htmlData) {

alert("In the Preview Dialog");

var preview = new Ext.Window({
title: "E-Form Preview",
width:650,
autoHeight: true,
html: htmlData,
y: 150,
listeners: {
beforeclose: function () {
searchVisible = false;
}
},
buttons: [
{
text: 'Close', handler: function() {
preview.close();
}
}
]
});

preview.show(this);
}

});




I tried but the second window(preview) is not appearing . please help me in this.

Thanks in advance.

Regards,
Sathya

pmatsumura
2 May 2011, 12:30 AM
Does your Ajax request successfully finish? Is showEformDialog called?

50120C1288
2 May 2011, 1:47 AM
No, it is showing ajax error. is this the correct procedure to follow. please help me. please provide me the sample examples ..thanks in advance

pmatsumura
2 May 2011, 1:51 AM
If your Ajax request never finishes successfully, then showEFormDialog will never be called.

50120C1288
2 May 2011, 2:48 AM
If your Ajax request never finishes successfully, then showEFormDialog will never be called.


Thanks Pmatsumura .

LakshmiS
30 Jun 2017, 4:28 AM
[Hi guys Im new to extjs. I want to know how to display or hide forms panels on button click event?
Thanks in advance