easyUI中toolbar中button禁止与隐藏

来源:互联网 发布:windows apache 启动 编辑:程序博客网 时间:2024/05/16 08:29

近期一个项目用到了easyUI,在使用过程中,遇到了一些个人觉得值得记录的注意点,片段化,在此记录谨供个人自由回忆,不保证质量!


在datagrid中根据权限需要隐藏或禁止部分Button,

 toolbar:[//工具条                    {id:"addId",text:"新增用户",iconCls:"icon-add",handler:function(){//回调函数}        ]            //隐藏工具按钮onLoadSuccess:function(){    buttonHandle(buttonUrl);}。。。。。。function buttonHandle(url) {    $.ajax({        type: 'post',        url: url,        cache:false,        dataType:'json',        success:function(result){            if (!result.add) {                $('#addId').hide();//button隐藏                //  $('#addId').linkbutton("disable");  //禁止button            }        } ,        error:function(result){            $.meesager.show({                title:result.status ,                 msg:result.message            });        }    });----------//启用$('#addId').linkbutton("enable");  //显示    $('#addId').show();                
0 0
原创粉丝点击