Navigation: Advanced topics > Programming topics > JavaScript API > Examples
To enable/disable a custom button use getItemButton() function.