首页 > javascript如何在点击这个“查看”的时候让“保存”这个button失效?

javascript如何在点击这个“查看”的时候让“保存”这个button失效?

点击查看
{

            xtype:'gridcolumn',
            header:'操作',
            width:60,
            sortable:true,
            renderer:function (value, metadata, record, rowIndex, colIndex, store) {
                return "<div 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></div>";
            }
        },

《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
跳转到
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)

}
《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
button
this.tbar={

        xtype:'toolbar',
        items:[
            '|',
            {
                xtype:'button',
                text:'保存',
                iconCls:'save',
                handler:function (){
                    win_save();
                }
            }, '|',
            {
                xtype:'button',
                text:'关闭',
                iconCls:'close',
                handler:function (){
                    windowUiIns.close();
                }
            }, '|'
        ]
    };

写个监听器就可以了

【热门文章】
【热门文章】