PDA

View Full Version : tree appendChild set model's phantom false. why???



ultra2
14 Mar 2012, 9:09 AM
This issue has been commented on Model's phantom property in docs.

So, when you create a new model, and add it to the tree:
var parentNode = you have a parent node to add to
var newModel = Ext.create(...);
parentNode.appendChild(newModel);
//this will decorate our new model with nodeInterface (NodeInterface.decorate) =>
//that will record.commit(true); =>
//that will set our model.phantom property to false. (no id in your model!!!)
//later you try to save changes of your treeStore
//in abstractStore filterNew and filterUpdated functions works based on phantom property
//store will send the new model to the update url. instead of the create url

ideas?