API Docs for: 1.0.1

Grape.TagContainer Class

Defined in: js\grape\etc\tag.js:2

A container for tagging. You can get items by tags.

Constructor

Grape.TagContainer

()

Item Index

Methods

createResultContainer

() Array

Creates an array-like object. If you want to redefine the result type of the get method, you can override this method.

Returns:

Array:

An initial array.

get

(
  • tag
)
Array

Gets items stored in the container by a tag.

Parameters:

  • tag String

    The tag

Returns:

Array:

Items containing the tag

Example:

 var container = new Grape.TagContainer();
 var obj = new Grape.Taggable();
 obj.setTagContainer(container);
 obj.addTag('my tag');
 container.get('my tag'); //returns an array containing obj