Results 1 to 4 of 4

Thread: Updating Contents on a Tab

  1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    US
    Posts
    2

    Default Updating Contents on a Tab

    I have the following definition for a "Tab" on a tab panel.

    PHP Code:
                           {                          title:'Daily TI(60)',                          borderfalse,                          xtype'panel',                          id'dailyid',                          padding10,                          flex1,                          html'<img src="URL will change" height="350" width="695"/>',                        }, 
    I would like the tab contents, which is a .jpg to be updated when i click on the tab to make it active. That, is the URL needs to be re-executed.

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    Consider using an Ext.Img for the graphic to be displayed. Take a look at the API docs and you'll see that you can call myImageComponent.setSrc('someURL') at any time to reload/refresh the image.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    US
    Posts
    2

    Default

    Thanks, I did read the API docs. But I am not sure how to modify the "Tab" information. That is, I am assuming one would drop the "html:" definition I currently have and replace it with Ext.Img. Would it be possible to suggest the exact syntax -- or point me to an example?

    Thanks

  4. #4
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    An Ext.Img can be added directly to your tabpanel, where the Img component itself becomes the new tab. The Img component will then also accept a 'title' attribute, so you can set the tab's text.

    As an alternative, I'd use a Panel with an items collection, in case I later wanted to add other components along with the image.

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
  •