PDA

View Full Version : how to detroy panel which is inside window



chauhan.achala
7 Mar 2012, 2:25 AM
hi i am creating a ext window and inside window i am trying to align panel . and panel has three componet
1)2 date field
2)combo box.
and above ext window i am creating onclick event of a button .but when i m trying to destroy ext window
window is getting detroy but i am unable to detroy panel inside window...
how to destroy panel.


i am giving my code here.:-/



function calWindow()
{

userstore = new Ext.data.SimpleStore({
fields: ['abbr', 'state'],
// autoLoad : true,
data :usersName
// Ext.userdata.states
});


StartDate =new Ext.form.DateField({
fieldLabel:'StartDate',
name:'txt-name',
format: 'd F Y',
emptyText:'',

value: '',
id:"StartDate" ,
closeAction : 'destroy'
})

EndDate =new Ext.form.DateField({
fieldLabel:'EndDate',
name:'txt-name',
format: 'd F Y',

value: '',
id:"EndDate" ,
closeAction : 'destroy'
})

Users =new Ext.form.ComboBox({

store: userstore,
displayField:'state',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select A User...',
selectOnFocus:true,
fieldLabel:'Users',

id:"Users"
})



var pan= new Ext.Panel({
closeAction:'destroy',
items:[
StartDate,EndDate,Users //adding the instance we created previously
] ,

buttons:[{
text:'OK',
// formBind:true,
iconAlign: "topb",
scope:this,
handler:function(){

var startDate = Ext.getCmp('StartDate').getValue();
var endDate = Ext.getCmp('EndDate').getValue();
var userName = Ext.getCmp('Users').getValue();

var fileArray = new Array(startDate,endDate,userName);
w.close();


getVmforUsr(fileArray);
}
}]
})






var w = new Ext.Window({
title : "ViewMachineDetails",
//html : 'My first Window',
closeAction :'destroy',
id : 'stwin',
height : 200,
width : 300,
constrain : true,
items : pan
})



}

mitchellsimoens
7 Mar 2012, 10:56 AM
The children of the window should be automatically destroyed when the window is.