In a permission decision, a button that has no permission action can be hidden directly ($.hide ()).
HTML definition
<a id= "Btnpreassign_generaltasks" class= "Easyui-linkbutton" iconcls= "Icon-edit" href= "#" plain= "true" > Assign Tasks </a> |
JS Fetch Object
var $btnPreAssign _generaltasks = $ (' #btnPreAssign_GeneralTasks '); |
Disable:
$btnPreAssign _generaltasks. LinkButton (' disable '); |
Enable:
$btnPreAssign _generaltasks. LinkButton (' Enable '); |
A problem:
When Linkbutton is disabled, its Click event will not be disabled, but the color of the button is dimmed, it is necessary to manually in the Click event to make the appropriate judgment, that is, "if the button is disabled, click the event also need to be canceled":
Determine if disabled: if disabled, the button's Click event will be canceled to guarantee consistent button behavior, which is not disabled when clicked and is disabled.
Assign task Open action $btnPreAssign _generaltasks.click (function () { if ($ (this). LinkButton (' Options '). Disabled) { return false; } .... } |
"Develop" form form Linkbutton disabled