PDA

View Full Version : PopUp Window



gudaya87
6 Feb 2013, 9:48 AM
I have a Button. On click of the button a popup Window should appear. The popup window has a Drop down box and two buttons namely Submit and Canel. On the popwindow ,when the user selects any value in the Dropdown and Click on submit ,I need to update this value in the Database. On click of cancel the popup window should be hidden .Can you please share any demo for this

sword-it
6 Feb 2013, 11:24 PM
Hi
I have created a sample code for you. try to do something like this





var win = Ext.create('Ext.window.Window', {
title: 'Demo',
height: 200,
width: 400,
layout: 'form',
bbar:[
{
text:'save'
, scope:this
, handler:function(){
var comboValue = Ext.getCmp('ComboName').getValue();
debugger;
Ext.Ajax.request({
url:'put your url here'
, params:{status:comboValue}
, success:function(data){
//do anything you want
}
});
}
},
{
text:'cancle',
scope:this,
handler:function(){
win.close();
}
}
]
, items: {
xtype: 'combo',
name:'status',
fieldLabel:'Status',
width:150,
id:'ComboName',
store: ['Active','Inactive']
}
});
var form = Ext.create('Ext.form.Panel', {
title: 'Simple Form',
autoHeight:true,
renderTo: Ext.getBody(),
items:[{
xtype:"button",
text:'Open Window',
handler:function(){
win.show()
}
}]
});