Class: Model

Model

new tart.base.Model()

Base model

Extends

  • goog.events.EventTarget

Methods

dispatchEvent(modelEvent){boolean}

Overriding goog.events.EventTarget's dispatchEvent method, to make this event consistent in application

Name Type Description
modelEvent Object | string

event object which has type, oldValue and newValue fields.

Returns:
Type Description
boolean .

getItems(dispatchEvent){Object}

getter for items

Name Type Description
dispatchEvent boolean optional

Whether this method should throw an event when its items are loaded. This may be used in classes that extend tart.base.Model.

Returns:
Type Description
Object items all items.

getTotalItemCount(){number}

Get total item count

Returns:
Type Description
number total item count for this model.

load(opt_callback)

Abstract method to load data from any resource

Name Type Description
opt_callback function optional

method after load.

setItems(items)

Setter for items

Name Type Description
items Object

items to be set.

setTotalItemCount(itemCount)

Set total item count

Name Type Description
itemCount number

total item count for this model.

Type Definitions

tart.base.Model.EventObject