I have created a panel and placed into the windows. when I click OK button in Window I can get the value of the panel.
var FormPanel = Ext.create('Ext.form.Panel', {
id: 'formpanel',
frame: true,
renderTo: Ext.getBody(),
xtype: 'radiogroup',
fieldLabel: 'Show',
layout: 'vbox',
items:
{
xtype: 'radiogroup',
layout: 'hbox',
items: [{
xtype: 'radiofield',
fieldLabel: 'PAN Number*',
margin: "20 0 0 0",
name: 'rb',
inputValue: '1',
checked: false,
listeners: {
change: function(cb, nv, ov) {
if (nv) {
Ext.getCmp('AttachData').disable();
Ext.getCmp('PanData').enable();
}
}
}
}, {
xtype: 'splitter'
}, {
xtype: 'textfield',
emptyText: 'Enter Owner\'s PAN...',
margin: "20 0 0 0",
id: 'PanData',
disabled: false
}, ]
},
});
var winPanDetails = Ext.create('Ext.window.Window', {
height: 250,
width: 400,
id:'winPanDetails',
layout: 'fit',
modal: true,
closable: true,
title: 'Document Attach',
items: [FormPanel],
constrain: true,
renderTo: Ext.getBody(),
buttons: [{
width: 50,
text: 'OK',
id: 'btnOk',
handler: function() {
if (Ext.getCmp('PanData').value == "") {
Ext.Msg.alert("Tax Benefit Declaration", "Please Pan Number");
return;
} else {
this.up('window').close();
}
}
}]
}).show();
I need to insert this window to my main panel...
Ext.create('Ext.form.Panel', {
renderTo: 'container',
title: 'Main Panel',
defaultType: 'textfield',
id: 'mainPanel',
bodyPadding: 10,
width: 780,
defaults: {
labelWidth: 100
},
items: [
{
button:[{
width: 50,
text: 'OK',
id: 'btnOk',
handler: function() {
}
}]
},
but after inserting I couldn't get the value of the window from my main panel. I tried many logics, Please help me with the logic
I cant get the value of Ext.getCmp('PanData').value outside the window
if (Ext.getCmp('PanData').value == "") {
Ext.Msg.alert("Tax Benefit Declaration", "Please enter pan number");
return;
}