EXT怎么样向后台传数据

js文件:
   Ext.onReady(function() {
    var form = new Ext.form.FormPanel({
    id:'form',
labelWidth : 75,
baseCls : 'x-plain',//作用在面板元素上的CSS样式类 (默认为 'x-panel')
defaults : {
width : 150
},//应用在全体组件上的配置项对象,无论组件是由items指定,抑或是通过add、insert的方法加入,都可支持。
defaultType : 'textfield',//默认字段类型

//定义表单元素
items : [ {
id:'zhangfu',
fieldLabel : '帐户',
name : 'name',//元素名称
//anchor:'95%',//也可用此定义自适应宽度
allowBlank : false,//不允许为空
blankText : '帐户不能为空'//错误提示内容
}, {
inputType : 'password',
fieldLabel : '密码',
//anchor:'95%',
name : 'pws',
allowBlank : false,
blankText : '密码不能为空'
} ] ,
buttons:[{
text : '提交',
type : 'button',
listeners:{
'click':function(){
var e = Ext.getCmp("zhangfu").getValue();
var store = new Ext.data.JsonStore({
    url: 'TextServlet',
    method:'psot',
    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
});
}
}
},{
text : '重置',
type : 'button',
listeners:{
'click':function(){
//重置表单
Ext.getCmp('form').form.reset();
}
}
}]
});

    var window = new Ext.Window({
        title: 'Resize Me',
        width: 250,
        height:150,
        layout: 'fit',
        plain:true,
        bodyStyle:'padding:5px;',
        buttonAlign:'center',
        items: form
    });
    window.show();
});

你可能感兴趣的:(ext)