tags:

views:

33

answers:

1

hello, i am confused about how i can add a link to the following code

    onReady: function() {
    new Ext.TabPanel({
        fullscreen: true,
        type: 'dark',
        sortable: true,
        items: [{
            title: 'Tab 1',
            html: '1',
            cls: 'card1'

to be able to directly load a url when i click the Tab 1. This code is from the sencha touch template. I want the htm part to be able to load a url when that tab is selected. thanks

+1  A: 

You can use autoLoad config option for this.

You can try,

  onReady: function() {
new Ext.TabPanel({
    fullscreen: true,
    type: 'dark',
    sortable: true,
    items: [{
        title: 'Tab 1',
       autoLoad   : {
                       url :youryrl,
                       scripts:true,
                        callback: function(){ yourcallbackfunction(); }
                     },

for detailed documentation, refer

http://examples.extjs.eu/

http://dev.sencha.com/deploy/dev/docs/

http://dev.sencha.com/deploy/ext/docs/output/Ext.TabPanel.html

http://www.sencha.com/learn/Tutorial:TabPanel_Basics

Hope this helps.

Yogesh
i didnt really find the appropriate usage of autoLoad in any except the second document. do u mind explaining how this would be used?
Alx
I have edited my answer, please check it now. Also, i have added extjs documentation link.
Yogesh
in my items would i use the autoload: 'url' or would i need to say autoLoad 'url:www.google.com'
Alx
For your case, targetUrl will be replaced by the url whose content you want to load in the tab. eg: If you want to load content of google then you can use goole url. In short, just replace targetUrl with your required url.
Yogesh
i am sorry i cant get this to work. as u see above i have items. when i try and add the autoLoad it doesnt work at all. is there any iframe alternative?
Alx
@Alx: i have edited the answer, please check now. It should work for you.
Yogesh