Results 1 to 5 of 5

Thread: Displaying contents of external url in tab

  1. #1
    Sencha User
    Join Date
    Jun 2015
    Posts
    6

    Default Displaying contents of external url in tab

    I need to display contents of external vendor url inside a tab(when user clicks it). Below is my code. However, it is not working. Can you please let me know what I am doing wrong?
    items: [
    new Ext.TabPanel({
    id: 'tabpanel',
    activeTab: activeTab,
    autoScroll: true,
    hidden: hiddenPanel,
    defaults: {autoScroll: true, autoHeight: true, autoWidth: true},
    items:[{
    id: 'test',
    title: "test",
    layout: "fit",
    url:"www.google.com",
    ticker: ""
    }], //third tab ended


    })]//end of tabpanel declaration

  2. #2
    Sencha Premium User danguba's Avatar
    Join Date
    Feb 2009
    Location
    Kragujevac, Serbia
    Posts
    462

    Default

    All Best
    ---
    Željko Mitrović
    http://skitanja.blogspot.com/

    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." Martin Golding

  3. #3
    Sencha User
    Join Date
    Jun 2015
    Posts
    6

    Default

    Got it working.
    Last edited by grind01; 26 Jan 2018 at 10:12 AM. Reason: Got to work out

  4. #4
    Sencha User
    Join Date
    Jun 2015
    Posts
    6

    Default

    Thanks a lot for your help Danguba. I also have a text box and enter button on UI and based on value entered in text box, I need to refresh contents of 3rd tab. Below is my code:


    {//second tab end, third tab starts
    id: 'test',
    title: "Test3",
    layout: "fit",
    html: iframebody,
    listeners: {
    'render': function()
    {


    },
    'show': function(panel){
    //var tickerValue1 = Ext.getCmp('tabpanel').getActiveTab().html;
    theurl = 'http://example.com?ticker=' +ticker+';
    iframebody = '<iframe width=100% height=100% src='+theurl+'></iframe>';
    var tab1= Ext.getCmp('tabpanel').setActiveTab(2);
    alert(Ext.getCmp('tabpanel').getActiveTab().html);
    Ext.getCmp('tabpanel').getActiveTab().html=iframebody;
    alert(Ext.getCmp('tabpanel').getActiveTab().html);
    Ext.getCmp('tabpanel').getActiveTab().getUpdater().refresh();
    },//show listener ended




    Now, when I press enter, tab doesnt get refreshed with new ticker even though the alert message shows updated html for the tab. Any help would be highly appreciated.

  5. #5
    Sencha Premium User
    Join Date
    Oct 2012
    Location
    United States
    Posts
    130

    Default

    Quote Originally Posted by grind01 View Post
    I need to display contents of external vendor url inside a tab(when user clicks it). Below is my code. However, it is not working. Can you please let me know what I am doing wrong?
    items: [
    new Ext.TabPanel({
    id: 'tabpanel',
    activeTab: activeTab,
    autoScroll: true,
    hidden: hiddenPanel,
    defaults: {autoScroll: true, autoHeight: true, autoWidth: true},
    items:[{
    id: 'test',
    title: "test",
    layout: "fit",
    url:"www.google.com",
    ticker: ""
    }], //third tab ended


    })]//end of tabpanel declaration
    Ext.Component has the same functionality as the ux solution but not needing a ux file - https://docs.sencha.com/extjs/6.2.0/...tml#cfg-autoEl ... We use this for displaying PDFs normally.

Similar Threads

  1. Displaying the full contents of a dataview
    By badash in forum Sencha Touch 2.x: Q&A
    Replies: 4
    Last Post: 28 Mar 2016, 11:29 AM
  2. load url external url contents as a plain/text
    By viravax in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 15 Aug 2011, 2:01 AM
  3. Panels from external pages no displaying
    By [email protected] in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 28 Jul 2009, 7:41 AM
  4. Grid not displaying store contents
    By vendiddy in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 21 Mar 2008, 4:35 PM

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
  •