Building Enterprise HTML5 Application

brite.dao.onResult

Triggered when a any dao action get resolved data change occur (create, delete, update, list, get, and any other dao methods). Since, DAO actions are asynchronous, it is important to note that this callback will occur when the result is resolved (and not when the action on the dao is called)

brite.dao.onResult(callback,namespace)

Triggered on any entity types and any actions. See below for params definition.

brite.dao.onResult(entityTypes, callback, namespace)

Triggered on a specified list of entity types for any actions. See below for params definition.

brite.dao.onResult(entityTypes, actions,callback,namespace)

Examples

var namespace = "any-namespace";

// bind "create", "update", and "list" actions on entity "User"
brite.dao.onDataChange("User","create,update, list",function(event){
  var daoEvent = event.daoEvent;
  console.log("action: " + daoEvent.action + " entityType: " + daoEvent.entityType + 
              " with result: ", daoEvent.result);
},namespace);

// bind any datachange events on entity of type "User"
brite.dao.onDataChange("User",function(){
   //...
},namespace);

// bind any datachange events on any entity types. 
brite.dao.onDataChange(function(){
  //...
},namespace);

Ask, learn, share about brite.js

Go to brite.js G+ community