Extjs常用的控件

var reportCategory = new Ext.form.ComboBox({
        fieldLabel: '报表类型',
        hiddenName:'reportCategory1',
        store: new Ext.data.SimpleStore({
            fields: ['num', 'name'],
            data : [[1,'年报表'],[2,'月报表'],[3,'日报表']]
        }),
        valueField:'num',
        displayField:'name',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        emptyText:'请选择...',
        selectOnFocus:true,
        width:120
    });


var dtYear = new Ext.form.NumberField({
        fieldLabel:'年',
        name:'dtYear1',
        allowBlank:false,
        allowDecimals:false,
        allowNegative:false,
        value:2008,
        minValue:2000,
        maxValue:2100,
        selectOnFocus:true,
        validationEvent:false,
        width:120
    });

var dtDay = new Ext.form.DateField({
        fieldLabel: '日期',
        name: 'dtDay1',
        width:120,
        validationEvent:false,
        allowBlank:false
    });

var fs = new Ext.form.FormPanel({
        frame: true,
        labelAlign: 'right',
        labelWidth: 60,
        autoHeight:true,
        autoWidth:true,
        onSubmit: Ext.emptyFn,
        submit: function(){
            this.getEl().dom.method='POST';
            this.getEl().dom.action='search.jsp';
            this.getEl().dom.submit();
        },
        waitMsgTarget: true,
        items: reportCategory
    });

 

比如fs需要提交的话 可以这样

    fs.getForm().submit();

 

 

posted @ 2010-01-25 09:17  饺子吃遍天  阅读(83)  评论(0编辑  收藏  举报