Dialog~DialogButton

On This Page

    Methods

    enable()

    Sets the button state to enabled

    Example

    1 AP.dialog.getButton('submit').enable();

    disable()

    Sets the button state to disabled. A disabled button cannot be clicked and emits no events.

    Example

    1
    AP.dialog.getButton('submit').disable();

    isEnabled (callback)

    Query a button for its current state.

    Parameters

    NameTypeDescription
    callback

    function

    function to receive the button state.

    Example

    1
    2
    3
    4
    5
    AP.dialog.getButton('submit').isEnabled(function(enabled){
      if(enabled){
        //button is enabled
      }
    });

    toggle()

    Toggle the button state between enabled and disabled.

    Example

    1
    AP.dialog.getButton('submit').toggle();

    trigger()

    Trigger a callback bound to a button.

    Example

    1
    2
    3
    4
    AP.dialog.getButton('submit').bind(function(){
      alert('clicked!');
    });
    AP.dialog.getButton('submit').trigger();

    isHidden (callback)

    Query a button for its current hidden/visible state.

    Parameters

    NameTypeDescription
    callback

    function

    function to receive the button state.

    Example

    1
    2
    3
    4
    5
    AP.dialog.getButton('submit').isHidden(function(hidden){
      if(hidden){
        //button is hidden
      }
    });

    hide()

    Sets the button state to hidden

    Example

    1
    AP.dialog.getButton('submit').hide();

    show()

    Sets the button state to visible

    Example

    1
    AP.dialog.getButton('submit').show();

    Rate this page: