"Develop" form form Linkbutton disabled

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.