added TabCachingWidget

This commit is contained in:
zadam
2020-01-14 20:27:40 +01:00
parent c9bc4ad108
commit 23701219e1
4 changed files with 74 additions and 37 deletions

View File

@@ -7,13 +7,17 @@ class BasicWidget {
this.widgetId = `widget-${this.constructor.name}`;
}
renderTo($parent) {
$parent.append(this.render());
}
render() {
// actual rendering is async
const $widget = this.doRender();
this.$widget = this.doRender();
// $widget.attr('id', this.widgetId);
return $widget;
return this.$widget;
}
/**
@@ -33,6 +37,10 @@ class BasicWidget {
this.appContext.trigger(name, data);
}
toggle(show) {
this.$widget.toggle(show);
}
cleanup() {}
}