top

CAPH.WUI.WIDGET.COLORTAG

ColorTag represents an manager for color tag. It mainly is for indicating the depth of UI, this widget can manage some of the tags, the tag is located in the upper left corner of the screen. Each tag has its own name, size and color, these tags were rendered in the stacked way.


Constructor

ColorTag

Description
The constructor of colortag component, in order to create colortag object.
Parameters
obj Objectthe options are some properties to a json object, some options is the same as parent class view, other different as below * maxShowNumber : (Number) * padding : (Number-unit) pixel * cls1 : (String) cls2, cls3
Emulator SupportY
SDK ConstraintNone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var options = {
        'width' : 400,
        'height' : 375,
        'maxShowNumber' : 5,
        'padding' : 5px,
        'cls1' : the CSS class of the first tag,
        'cls2' : the CSS class of the second tag,
        'cls3' : the CSS class of the third tag
    };
var colorTag = new ColorTag(options);

Methods

addTag

Description
Add tag on the current screen.
Parameters
■name
  - String
  - The name of tag
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var colorTag = new ColorTag();
colorTag.addTag('first'); 
colorTag.addTag('second');

back

Description
Back to pervious UIContext.
Parameters
■Void
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var colorTag = new ColorTag();
colorTag.addTag('first'); 
colorTag.addTag('second'); 
colorTag.back();
colorTag.back();

getColorTagItem

Description
Returns the color tag by index
Parameters
■index
  - Number
  - The index of the item in color tags, range from 0 to the max number of color tags(not include the max number).
Return■colortag
  -  Object
  -  The item of colorTag refer to the index.
Emulator SupportY
SDK Constraintnone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var colorTag = new ColorTag();
colorTag.addTag('first'); 
colorTag.addTag('second'); 
colorTag.getColorTagItem(0);

hide

Description
Hide the color tag when current uicontext is home uicontext or detail uicontext.
Parameters
■Void
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var colorTag = new ColorTag();
colorTag.addTag('first'); 
colorTag.addTag('second'); 
colorTag.hide();

ColorTag

Description
(Constructor) The constructor of colortag component, in order to create colortag object.
Parameters
■options (Optional)
  - Object
  - the options are some properties to a json object, some options is the same as parent class view, other different as below
   * maxShowNumber : (Number)
   * padding : (Number-unit) pixel
   * cls1 : (String) cls2, cls3
Return■Object
  - instance of colortag
Emulator SupportY
SDK Constraintnone
Example
var ColorTag  = caph.wui.widget.ColorTag;
var options = {
        'width' : 400,
        'height' : 375,
        'maxShowNumber' : 5,
        'padding' : 5px,
        'cls1' : the CSS class of the first tag,
        'cls2' : the CSS class of the second tag,
        'cls3' : the CSS class of the third tag
    };
var colorTag = new ColorTag(options);

clone

Description
Creates and returns clone object from current object, the cloned object will have the same properties and same methods with the current object.
Parameters
■Void
Return■Object
  - The cloned object.
Emulator SupportY
SDK Constraintnone
Example
var ColorTag = window.caph.wui.widget.ColorTag;
var colorTag =new ColorTag();
var obj = colorTag.clone();

equals

Description
Compares the contents of two objects using strict equality, objects are considered equal if they both have the same set of properties and the values of those properties are equal.
Parameters
■Object
  - Object
  - The object which wants to compare with current object.
Return■Boolean
  - Indicates whether the two objects are equal
  - true : if they are equal, return true. 
  - false : if they aren't equal, return false.
Emulator SupportY
SDK Constraintnone
Example
var ColorTag = window.caph.wui.widget.ColorTag;
var colorTag =new ColorTag();
var obj = colorTag.clone();
var isequal = colorTag.equals(obj);