1. #1
    Ext User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    newname2008 is on a distinguished road

      0  

    Default Error: formpanel , tabpanel and formpanel again

    Error: formpanel , tabpanel and formpanel again


    well, if you first create a formpanel, and load a tabpanel in its items. At the same time, you new another formpanel, and add it to the tab ot this tabpanel. You can find there is no export in the tab of tabpanel. My code is below. If you chage the red color char to Panel or Window, everything is OK.

    Code:
    test = {
        dataRecord: ['text'],
        urlSave: 'tabpanel.html',
    
        createDialog: function() {
    
            var reader = new Ext.data.JsonReader({}, this.dataRecord);
            this.formPanel = new Ext.form.FormPanel({
                defaultType: 'textfield',
                labelAlign: 'right',
                labelWidth: 70,
                frame: true,
                autoScroll: true,
                title: '详细信息',
                reader: reader,
                url: this.urlSave,
                items: [{
                    xtype: 'hidden',
                    name: 'id'
                },{
                    fieldLabel: '姓      名',
                    //readOnly:true,
                    name: 'name',
                    allowBlank: false,
                    width: 200
                }],
                buttons: [{
                    text: '确定',
                    handler: function() {
                        if (this.formPanel.getForm().isValid()) {
                            this.formPanel.getForm().submit({
                                waitTitle: "请稍候",
                                waitMsg : '提交数据,请稍候...',
                                success: function() {
                                    this.dialog.hide();
                                    this.refresh();
                                },
                                failure: function() {
                                },
                                scope: this
                            });
                        }
                    }.createDelegate(this)
                },{
                    text: '取消',
                    handler: function() {
                        this.dialog.hide();
                    }.createDelegate(this)
                }]
            });
    
            var tabs = new Ext.TabPanel({
                title:'tab',
                //renderTo: document.body,
                height: 500
            });
    
            tabs.add({
                title: '基本信息',
                // html: 'http://#'
                deferredRender:false,
                items:[this.formPanel]
            });
            tabs.add({
                title: '业务水平',
                html: '内容2'
                // closable: true
            });
    
            tabs.activate(0);
    
            this.dialog = new Ext.form.FormPanel({
                layout: 'fit',
                width: this.dlgWidth ? this.dlgWidth : 400,
                height: this.dlgHeight ? this.dlgHeight : 400,
                //closeAction: 'hide',
                items: [tabs]
            });
        }
    };
    
    
    Ext.onReady(function(){
    
        test.createDialog();
        test.dialog.render(document.body);
    
    });
    Last edited by evant; 29 Jun 2009 at 12:15 AM. Reason: Please put code in [code][/code] tags

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,103
    Vote Rating
    500
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You can't nest forms inside forms. If you have:

    Code:
    FormPanel
         TabPanel
              FormPanel
    You're going to end up with nested form tags.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar