Results 1 to 2 of 2

Thread: load iframe on radiobutton click

  1. #1
    Sencha User
    Join Date
    May 2016
    Posts
    11

    Default load iframe on radiobutton click

    I am trying to build a page with two radio buttons. each button points should point to a different iframe which should be loaded in the body just below these radio buttons.
    radio button 1 should be checked by default and must load iframe1. on clicking radio button 2, we load iframe 2. For now I would like to hard code the iframe and in future would like to parametrize it. It doesnt render anything. Please point me as to how to load this iframe?.

    Code:
    Ext.define('xxx.somepage', {
        extend: 'xxx.UI..BorderlessPanel',   
        width: '100%',
        height: 125,
        bodyPadding: 10,
        border:10 ,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'radiogroup',
            columns: 2,
            width: 400,
            horizontal: true,      
            items: [        
                            {
                                boxLabel: 'Dashboard1',
                                name: 'MOD',
                                inputValue: 'Dashboard1',
                                checked: true,
                                listeners: {
                                    click: function () {                                    
                                     new Ext.Panel({   
                                                  title :"iframe", 
                                                  width :300,   
                                                  height:300,   
                                                  layout :'fit',  
                                                  items :[
                                                        {        xtype :"component", 
                                                               autoEl :{     
                                                                           tag :"iframe", 
                                                                           src :"http://www.yahoo.com"}}]}).show();    
                                                              }
                                                       }
                               },
                             {
                                 boxLabel: 'Dashboard2',
                                 name: 'TTT',
                                 inputValue: 'Dashboard2',
                                 listeners: {
                                     onClick: function () {   
                                     newExt.Panel({   
                                                  title :"iframe", 
                                                  width :300,   
                                                  height:300,   
                                                  layout :'fit',  
                                                  items :[
                                                        {        xtype :"component", 
                                                               autoEl :{     
                                                                           tag :"iframe", 
                                                                           src :"http://www.yahoo.com"}}]}).show();    
                                                              }
                                                       }
                                
                                     }
                                 }
    
    
                             }
                 ]
        }]
    
    
    
    
    });

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    There's no click event on a radio button. Perhaps you could use the change event?

Similar Threads

  1. Replies: 3
    Last Post: 19 Jun 2015, 4:03 PM
  2. Replies: 7
    Last Post: 13 Feb 2014, 11:59 AM
  3. radiobutton on click
    By spor in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 28 May 2010, 12:28 AM
  4. Can't load values for Radiobutton
    By fischel in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 4 Dec 2007, 10:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •