Component.Controller

Base Controller class for KISSY Component. xclass: 'controller'.

parents: Component.UIBase, Component.UIBase.Box

defined in: controller.js

Attributes

  • active {Boolean} Whether this component is activated.
  • activeable {Boolean} Whether this component can be activated.
  • children {Component.Controller[]} Array of child components
  • disabled {Boolean} Whether this component is disabled.
  • focusable {Boolean} Whether this component can get focus.
  • focused {Boolean} Whether this component has focus.
  • handleMouseEvents {Boolean} Enables or disables mouse event handling for the component.
  • highlighted {Boolean} Whether this component is highlighted.
  • parent {Component.Controller} This component's parent component.
  • prefixCls {String} This component's prefix css class.
  • view {Component.Render} Renderer used to render this component.

Methods


Class Detail

  • Component.Controller ()
    Base Controller class for KISSY Component. xclass: 'controller'.

Attributes Detail

  • active {Boolean} Whether this component is activated.
  • activeable {Boolean} Whether this component can be activated. Default : true.
  • children {Component.Controller[]} Array of child components
  • disabled {Boolean} Whether this component is disabled.
  • focusable {Boolean} Whether this component can get focus. Default : true.
  • focused {Boolean} Whether this component has focus.
  • handleMouseEvents {Boolean} Enables or disables mouse event handling for the component. Containers may set this attribute to disable mouse event handling in their child component. Default : true.
  • highlighted {Boolean} Whether this component is highlighted.
  • parent {Component.Controller} This component's parent component.
  • prefixCls {String} This component's prefix css class.
  • view {Component.Render} Renderer used to render this component.

Methods Detail

  • addChild (c, index) view source
    Add the specified component as a child of current component at the given 0-based index.
    Parameters
    •   c {Component.Controller|Object} Child component instance to be added or Object describe child component
    • [ c.xclass ] {String} When c is a object, specify its child class.
    • [ index ] {Number} 0-based index at which the new child component is to be inserted; If not specified , the new child component will be inserted at last position.
  • bindUI () view source
    From UIBase. Bind focus event if component is focusable.
  • createDom () view source
    From UIBase. Constructor(or get) view object to create ui elements.
  • getChildAt (index) view source
    Returns the child at the given index, or null if the index is out of bounds.
    Parameters
    •   index {Number} 0-based index.
    Returns
  • getCssClassWithPrefix (classes) view source
    Get full class name for current component
    Parameters
    •   classes {String} class names without prefixCls. Separated by space.
    Returns
    • {String} class name with prefixCls
  • handleBlur (ev) view source
    Handles blur events. Remove focused class.
    Parameters
  • handleDblClick (ev) view source
    Handle dblclick events. By default, this performs its associated action by calling Component.Controller#performActionInternal.
    Parameters
  • handleFocus (ev) view source
    Handles focus events. Style focused class.
    Parameters
  • handleKeydown (ev) view source
    Handle keydown events. If the component is not disabled, call Component.Controller#handleKeyEventInternal
    Parameters
  • handleKeyEventInternal (ev) view source
    Handle enter keydown event to Component.Controller#performActionInternal.
    Parameters
  • handleMouseDown (ev) view source
    Handles mousedown events. If the component is not disabled, If the component is activeable, then activate it. If the component is focusable, then focus it, else prevent it from receiving keyboard focus.
    Parameters
  • handleMouseEnter (ev) view source
    Handle mouseenter events. If the component is not disabled, highlights it.
    Parameters
  • handleMouseLeave (ev) view source
    Handle mouseleave events. If the component is not disabled, de-highlights it.
    Parameters
  • handleMouseUp (ev) view source
    Handles mouseup events. If this component is not disabled, performs its associated action by calling Component.Controller#performActionInternal, then deactivates it.
    Parameters
  • initializer () view source
    From UIBase, Initialize this component.
  • performActionInternal (ev) view source
    Performs the appropriate action when this component is activated by the user.
    Parameters
  • removeChild (c, destroy) view source
    Removed the given child from this component,and returns it. If destroy is true, calls Component.UIBase.#destroy on the removed child component, and subsequently detaches the child's DOM from the document. Otherwise it is the caller's responsibility to clean up the child component's DOM.
    Parameters
    •   c {Component.Controller} The child component to be removed.
    • [ destroy = false ] {Boolean} If true, calls Component.UIBase.#destroy on the removed child component.
    Returns
  • removeChildren (destroy) view source
    Removes every child component attached to current component.
    Parameters
    • [ destroy ] {Boolean} If true, calls Component.UIBase.#destroy on the removed child component.
    See
  • renderUI () view source
    From UIBase. Call view object to render ui elements.
blog comments powered by Disqus
Top