日期:2014-05-16  浏览次数:20929 次

Extjs的form传递参数问题。
本帖最后由 showbo 于 2012-08-10 10:49:19 编辑
addEmployee.jsp中的form表单代码
Ext.onReady(function() {
    var form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        labelWidth: 55,
        url:'save-form.php',
        defaultType: 'textfield',
        items: [{
            fieldLabel: '用户名',
            name: 'username',
            anchor:'100%'  // anchor width by percentage
        },{
            fieldLabel: '密码',
            inputType: 'password',
            name: 'password',
            anchor: '100%'  // anchor width by percentage
        },{       
         xtype: 'radiogroup',
            fieldLabel: '性别',
            name:'gender',
          
          items: [
                {boxLabel: '男', name: 'rb-auto', inputValue: 1},
                {boxLabel: '女', name: 'rb-auto', inputValue: 2},            
            ]
        
        }],
           buttons: [{
            text: '保存',
            handler: function(){
            
             Ext.Ajax.request({   
                url : 'manage_add.action', 
        params:{'username':'username','password':'password','gender':'gender'},
                method : 'post',   
                success : function(response) {   
                 Ext.Msg.alert("提示", "方法调用成功");