Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.


JavaScript
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...

C#
Ext.create('Ext.form.Panel', {
       renderTo: 'container',
       title: 'Main Panel',
       defaultType: 'textfield',
       id: 'mainPanel',
       bodyPadding: 10,
       width: 780,
       defaults: {
           labelWidth: 100
       },
       items: [
       {
        //Some more fields
         button:[{
                       width: 50,
                       text: 'OK',
                       id: 'btnOk',
                       handler: function() {
                         //My Window
                    }
               }]
       },


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

C#
if (Ext.getCmp('PanData').value == "") {
                    Ext.Msg.alert("Tax Benefit Declaration", "Please enter  pan number");
                    return;
                }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900