搜索
javascript如何让这个保存按钮失效?
阿神
阿神 2017-04-10 15:47:20
[JavaScript讨论组]

让它在点击“放大镜”的时候,保存按钮失效,点击“本子”的时候可以保存。
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
{
xtype:'gridcolumn',
header:'操作',
width:60,
sortable:true,
renderer:function (value, metadata, record, rowIndex, colIndex, store) {

   return "<p width='30' align='center'><a href=javascript:edit_window(" + rowIndex + ")><img src='" + _root + "/res/img/biaoji/edit.png' title='编辑'/><a href=javascript:view_window(" + rowIndex + ")><img src='" + _root + "/res/img/biaoji/lookup.png' title='查看'/></a></p>";

}
},
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
function view_window(){
var rec = sw_editorgridpanelUiIns.getSelectionModel().getSelected();
windowUiIns = new windowUi();
windowUiIns.show();
Ext.getCmp('dbid').setValue(rec.get('dbid'));
Ext.getCmp('code').setValue(rec.get('code'));
Ext.getCmp('name').setValue(rec.get('name'));
Ext.getCmp('count_student').setValue(rec.get('count_student'));
Ext.getCmp('teacher_name').setValue(rec.get('teacher_name'));
Ext.getCmp('staff_name').setValue(rec.get('staff_name'));
Ext.getCmp('create_date').setValue(rec.get('create_date'));
setReadOnlyWithCss(['code', 'name', 'count_student', 'teacher_name'],true)
}
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
{

                xtype:'button',
                text:'保存',
                iconCls:'save',
                handler:function (){
                    win_save();
                }
                《《《《《《《《《《《《《《《《《《《《《《《《《《,

function win_save(){

var dbid = Ext.getCmp('dbid').getValue();
var code = Ext.getCmp('code').getValue();
var name = Ext.getCmp('name').getValue();
var count_student = Ext.getCmp('count_student').getValue();
var teacher_name = Ext.getCmp('teacher_name').getValue();
Ext.Ajax.request({
    'url':hdmp.root+'/process/test_sw?method=save_win' ,
    params: {
        dbid:dbid,
        code:code,
        name:name,
        count_student:count_student,
        teacher_name:teacher_name
    },
    method:'post',
    waitTitle:'提示',
    waitMsg:'正在提交数据',
    business:function(meg) {
        Ext.Msg.alert('提示', '保存成功!', function(id) {
            windowUiIns.close();
            query_sw();
        });
    },
    success:ajaxRequestSuccess,
    failure:requestError
});

}

阿神
阿神

闭关修行中......

全部回复(2)
天蓬老师

Ext.jsButton提供了disabled属性和setDisabled方法可以帮你灵活的控制button的状态,
看文档:Ext.button

黄舟

用一个变量记录 打开这个页面 时是点击的本子还是放大镜, 然后点击保存的时候判断此变量,是放大镜就return false。 这个跟javascript无关吧,是思路的问题。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号