`

Extjs-form实例1

    博客分类:
  • ext
EXT 
阅读更多

Extjs-form实例:

1Ext.onReady(function(){

 var form = new Ext.form.FormPanel({

    defaultType: 'textfield',

    labelAlign: 'right',

title: 'form',

labelWidth: 50,  

    frame: true,                          

    width: 220,                           

    items: [{                             

        fieldLabel: '文本框'             

    }],                                    

    buttons: [{                          

        text: '按钮'                       

    }]                                      

});

form.render("form"); 

});

 

2Ext.onReady(function() {

    var form = new Ext.form.FormPanel({

        labelWidth: 55,

        defaultType: 'textfield',

        items: [{

            fieldLabel: 'Send To',

            name: 'to',

            anchor:'100%'  // anchor width by percentage

        },{

            fieldLabel: 'Subject',

            name: 'subject',

            anchor: '100%'  // anchor width by percentage

        }, {

            xtype: 'textarea',

            hideLabel: true,

            name: 'msg',

            anchor: '100% -53'  // anchor width by percentage and height by raw adjustment

        }]

    });

    var window = new Ext.Window({

        title: 'Resize Me',

        width: 500,

        height:300,

        minWidth: 300,

        minHeight: 200,

        layout: 'fit',

        plain:true,

        bodyStyle:'padding:5px;',

        buttonAlign:'center',

        items: form,

        buttons: [{

            text: 'Send'

        },{

            text: 'Cancel'

        }]

    });

    window.show();

});

3var store = new Ext.data.SimpleStore({

    fields: ['abbr', 'state'],

    data : exampleData

});

var combo = new Ext.form.ComboBox({

    store: store,

    displayField:'state',

    typeAhead: true,

    mode: 'local',

    triggerAction: 'all',

    emptyText:'Select a state...',

    selectOnFocus:true,

    applyTo: 'local-states'

});

分享到:
评论
1 楼 haiyangyiba 2010-05-07  
没有详细点的注释,对于我这样的初学者来讲,头疼呀

相关推荐

Global site tag (gtag.js) - Google Analytics