MyDesktop.TabWindow = Ext.extend(Ext.app.Module, {
    id:'tab-win',
    init : function(){
        this.launcher = {
            text: 'Tab Window',
            iconCls:'tabs',
            handler : this.createWindow,
            scope: this
        }
    },    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('tab-win');
        if(!win){
            win = desktop.createWindow({
                id: 'tab-win',
                title:'Tab Window',
                width:740,
                height:480,
                iconCls: 'tabs',
                shim:false,
                animCollapse:false,
                border:false,
                constrainHeader:true,                layout: 'fit',
                items:
                    new Ext.TabPanel({
                        activeTab:0,                        items: [{
                            title: 'Tab Text 1',
                            header:false,
                            html : '<p>Something 1 useful would be in here.</p>',
                            border:false
                        },{
                            title: 'Tab Text 2',
                            header:false,
                            html : '<p>Something 2 useful would be in here.</p>',
                            border:false
                        },{
                            title: 'Tab Text 3',
                            header:false,
                            html : '<p>Something 3 useful would be in here.</p>',
                            border:false
                        },{
                            title: 'Tab Text 4',
                            header:false,
                            html : '<p>Something 4 useful would be in here.</p>',
                            border:false
                        }]
                    })
            });
        }
        win.show();
    }
});
以上代码是模拟带选项卡的窗口,第一个选项卡的内容
html : '<p>Something 1 useful would be in here.</p>',
我想改为新浪的内容
改为url:'http://www.sina.com.cn',
或者link:'http://www.sina.com.cn',
怎么都不行?!第二个问题,html : '<p>Something 1 useful would be in here.</p>',
是哪个DOM对象的value值?

解决方案 »

  1.   

    第一个问题:
    html : '<a href="http://www.sina.com.cn" ><p>Something 1 useful would be in here.</p></a>'第二个问题:
    html : '<p id="abc">Something 1 useful would be in here.</p>'
    取值的话,document.getElementById("abc").value;
      

  2.   

    第二个问题写错了应该是:document.getElementById("abc").innertext;
      

  3.   

    楼上回答的什么啊?真让我哭笑不得!
    第一个问题,我想显示的是新浪的内容,不是在文字旁边加个新浪链接!
    第二个问题,我问的是从ext一直继承下来的哪个对象?我真败给你了!你这是说相声吗?
      

  4.   

    第一个问题  
    加个不要html属性,换成autoLoad:{url:'http://www.sina.com.cn'}
    第二个问题
    给Tab Text 1加个Id
    然后document.getElementById(加的ID).innerHTML
      

  5.   

    第二个问题我问错了, '<p>Something 1 useful would be in here.</p>',
    是哪个对象或类的哪个属性的值?
    和DOM无关了。
    用ext的方法怎样修改 '<p>Something 1 useful would be in here.</p>',