[common] Add event item:expand for TreeView

This commit is contained in:
Alexei Koshelev
2024-03-04 02:40:59 +03:00
parent fa2d583024
commit bc396cdefa

View File

@ -248,6 +248,7 @@ define([
record.set('isExpanded', isExpanded);
this.store[(isExpanded) ? 'expandSubItems' : 'collapseSubItems'](record);
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
this.trigger('item:expand', record, isExpanded, !isExpanded);
} else
Common.UI.DataView.prototype.onClickItem.call(this, view, record, e);
},
@ -269,17 +270,21 @@ define([
expandRecord: function(record) {
if (record) {
var oldExpand = record.get('isExpanded');
record.set('isExpanded', true);
this.store.expandSubItems(record);
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
this.trigger('item:expand', record, true, oldExpand);
}
},
collapseRecord: function(record) {
if (record) {
var oldExpand = record.get('isExpanded');
record.set('isExpanded', false);
this.store.collapseSubItems(record);
this.scroller.update({minScrollbarLength: this.minScrollbarLength, alwaysVisibleY: this.scrollAlwaysVisible});
this.trigger('item:expand', record, false, oldExpand);
}
},