ext动态新增一行之二

ext 动态 新增行 新增一行(2)
-------------------------------------------------------------------------------------------
    //定义表单
    var simple = new Ext.FormPanel({
        labelAlign: 'left',
        title: '添加子部门',
        buttonAlign: 'right',
        bodyStyle: 'padding:5px',
        //width: 600,
        autoHeight: true,
        autoWidth: true,
        //
        frame: true,
        labelWidth: 80,
        // items: [ ]        ,
        buttons: [{
            text: '保存',
            type: 'submit',
            //定义表单提交事件
            handler: function(){
           
           
                if (simple.form.isValid()) {//验证合法后使用加载进度条
                    Ext.MessageBox.show({
                        title: '请稍等',
                        msg: '正在加载...',
                        progressText: '',
                        width: 300,
                        progress: true,
                        closable: false,
                        animEl: 'loding'
                    });
                    //控制进度速度
                    var f = function(v){
                        return function(){
                            var i = v / 11;
                            Ext.MessageBox.updateProgress(i, '');
                        };
                    };
                   
                    for (var i = 1; i < 13; i++) {
                        setTimeout(f(i), i * 150);
                    }
                   
                    //提交到服务器操作
                    simple.form.doAction('submit', {
                        url: newSaveOrgFrameUrl,//文件路径
                        method: 'post',//提交方法post或get
                        params: '',
                        //提交成功的回调函数
                        success: function(form, action){
                            if (action.result.msg == 'ok') {
                           
                           
                           
                                Ext.MessageBox.show({
                                    title: '系统提示信息',
                                    msg: '添加成功!',
                                    buttons: Ext.MessageBox.OK,
                                    icon: Ext.MessageBox.INFO,
                                    fn: function(btn, text){
                                   
                                   
                                   
                                    }
                                });
                            }
                            else {
                                Ext.Msg.alert('添加错误', action.result.msg);
                            }
                        },
                        //提交失败的回调函数
                        failure: function(){
                            Ext.Msg.alert('错误', '服务器出现错误请稍后再试!');
                        }
                    });
                }
            }
        }, {
            text: '重置',
            handler: function(){
                simple.form.reset();
            }//重置表单
        }, {
            text: '取消',
            handler: function(){
                win.close();
            }//重置表单
        }]
    });
    //添加第一个fieldSet
    simple.add(first_Org_fieldSet);
   
    //菜单面板
    var panel = new Ext.Panel({
        bodyStyle: 'width:100%',
        autoWidth: true,
        autoHeight: true,
        //autoScroll: true,
        renderTo: Ext.getBody(),
        //
       
        title: '',
        bodyStyle: 'padding:10px;',
        tbar: [{
            xtype: 'tbseparator'
        }, newDept_action, { // <-- Add the action directly to a toolbar
            xtype: 'tbseparator'
        }],
        items: [simple]
   
    });
   
    return panel;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值