如何禁用easyui中linkbutton的click事件
的有关信息介绍如下:linkbutton禁用只能禁用样式,不能禁用click事件。$('#btn').linkbutton('disable');解决方法:第一种方法:juqery unbind方法第二种方法:判断下disable属性 $('#btn').linkbutton('disable');$('#btn').click(function () {if ($(this).linkbutton('options').disabled == false) {alert('a')}});第三种方法:拓展:function setDisabled(target, disabled) { var state = $.data(target, "linkbutton"); if (disabled) { state.options.disabled = true; var href = $(target).attr("href"); if (href) { state.href = href; $(target).attr("href", "javascript:void(0)"); } if (target.onclick) { state.onclick = target.onclick; target.onclick = null; } //事件处理 var events = $(target).data("events"); if(events){ var clicks = events.click;//暂时只处理click事件 state.events = state.events||[]; $.extend(state.events, clicks); $(target).unbind("click"); } $(target).addClass("l-btn-disabled"); } else { state.options.disabled = false; if (state.href) { $(target).attr("href", state.href); } if (state.onclick) { target.onclick = state.onclick; } if (state.events) { for ( var i=0;i