Hi Jeremy,
thanks for the quick reply. It worked.
I thought internally i wouldn't use the transclude widget but using the
widget tree is really nice.
What I use as equivalent for {{currentview}} is now
/**
* Compute the internal state of the widget
*/
TaskGraphWidget.prototype.execute = function() {
// Construct the child widgets
var body = {
type : "element",
tag : "div",
attributes : {
class : { type : "string", value : "filterbar" }
},
children : [{
type : "tiddler",
attributes : {
tiddler : { type : "string", value : this.getCurView().fields.title
}
},
children : [{
type : "transclude"
}]
}]
};
this.makeChildWidgets([body]);
};
I removed the tiddler attribute for transclude as it seems to use the
currentTiddler as fallback. Also I use the tiddler Widget as parent because
otherwise, the other transcludes (my graphview transcludes itself
"$:/core/ui/EditTemplate/tags") would not be bound to the graphview.
I tried the following at first, but it did not set the currentTiddler for
consequent transcludes.
// transclude works, but currentTiddler is not propagated to other
transcludes so e.g. changes of tags are not written to the parent.
var body = {
type : "transclude",
attributes : {
tiddler : { type : "string", value : this.getCurView().fields.title
}
}
};
During refresh() I check if the currentview (this.getCurView()) has changed
and rebuild only the subtree via
this.removeChildDomNodes();
this.execute();
this.renderChildren(this.parentDomNode);
So it all works fine. :)
I just posted my result for documentation purposes (hope I didn't say
something wrong).
Thanks!
Felix
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.