dojo.data.api.Notification.onNew
dojo.require("dojo.data.api.Notification");
defined in dojo/data/api/Notification.js
This function is called any time a new item is created in the store. It is called immediately after the store newItem processing has completed.
Usage
function (newItem, /*Object?*/ parentInfo) (view source)
parameter | type | description |
---|---|---|
newItem | The item created. | |
parentInfo | Object | Optional. An optional javascript object that is passed when the item created was placed in the store hierarchy as a value f another item's attribute, instead of a root level item. Note that if this function is invoked with a value for parentInfo, then onSet is not invoked stating the attribute of the parent item was modified. This is to avoid getting two notification events occurring when a new item with a parent is created. The structure passed in is as follows: { item: someItem, //The parent item attribute: "attribute-name-string", //The attribute the new item was assigned to. oldValue: something //Whatever was the previous value for the attribute. //If it is a single-value attribute only, then this value will be a single value. //If it was a multi-valued attribute, then this will be an array of all the values minues the new one. newValue: something //The new value of the attribute. In the case of single value calls, such as setValue, this value will be //generally be an atomic value of some sort (string, int, etc, object). In the case of multi-valued attributes, //it will be an array. } |