pragma-views2
Version:
24 lines (20 loc) • 551 B
JavaScript
export class HierarchicalItem {
constructor(model, isExpanded = false, hasChildren = true, depth = -1) {
this.model = model;
this.isExpanded = isExpanded;
this.hasChildren = hasChildren;
this.depth = depth + 1;
}
get title() {
return this.model.title || this._title;
}
set title(newValue) {
this.title = newValue;
}
addItem(item) {
if (this.items == undefined) {
this.items = [];
}
this.items.push(item);
}
}