Class: RemoteModel

RemoteModel

new tart.components.models.RemoteModel()

Remote Model

Extends

Members

entityClass

RemoteModel's entity class. Default value is undefined.

url

RemoteModel's request url. Default value is undefined.

Methods

inherited 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 .

inherited 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.

inherited getTotalItemCount(){number}

Get total item count

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

load(opt_callback)

Load data and map data to entity.

Name Type Description
opt_callback function optional

method to call after load.

protectedmapDataToEntities(xhrData)

map data to entity class.

Name Type Description
xhrData Object

data returned from xhr request.

inherited setItems(items)

Setter for items

Name Type Description
items Object

items to be set.

inherited setTotalItemCount(itemCount)

Set total item count

Name Type Description
itemCount number

total item count for this model.