Opened 9 years ago

Closed 9 years ago

#10861 closed defect (invalid)

parentInfo.item in dijit.tree.TreeStoreModel is wrong according to dojo.data.api.Write

Reported by: riceyeh Owned by: anonymous
Priority: high Milestone: tbd
Component: Dijit Version:
Keywords: Cc:
Blocked By: Blocking:

Description

Based on the documentation on dojo.data.api.Write, the field holding the parent item in the argument parentInfo of the onNewItem method should be parentInfo.parent. In dijit.tree.TreeStoreModel?, parentInfo.item is mistakenly used on mehtod onNewItem.

Change History (1)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Resolution: invalid
Status: newclosed

Looks like the same as #10818, which we determined to be invalid. TreeStoreModel.onNewItem() is connected to the store's onNew(), and the arguments from dojo.data.api.Notification.onNew are:

//	parentInfo:
//		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.  
//		}
Note: See TracTickets for help on using tickets.