Permalink
Browse files

convenience method for child index

  • Loading branch information...
1 parent 560936d commit d07320363e8bca8c95510df52ab5f1b7ca843a17 @danwu danwu committed Jan 20, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 modules/model/ModelBase.js
@@ -53,6 +53,11 @@ define(function () {
return properties.length > 0;
}
+ that.indexUnderParent = function() {
+ return arrayUtils.findIndexBy(parent.getChildren(), function(obj) {
+ return obj.getId() === id;
+ });
+ }
that.removeChild = function (child) {
arrayUtils.remove(children, child);

0 comments on commit d073203

Please sign in to comment.