I tried with
var tiddler=this.wiki.getTiddler(this.clearTiddler);
if(tiddler){
tiddler.fields.text="";
this.wiki.addTiddler(tiddler);
}
And it is working for the tiddler content. Now I want to clear too the
custom fields. Is there any way to distinguish between default and custom
fields? In any case this is for temp tiddlers, so maybe I there is no
problem clearing all the fields.
El miércoles, 2 de abril de 2014 16:50:17 UTC+2, Danielo Rodríguez escribió:
>
> Hello everyone.
>
> I'm going deeper but slowly ind TW5 programming.
> I want to clear a certain tiddler content and custom fields from within a
> widget.
>
> I read the full code of edit-text, and I think I located where the edition
> occurs.
> The function getEditInfo returns an object with the value of the edit and
> a function that updates the tiddler.
> Here is the Update Function
>
> update = function(value) {
>> var tiddler = self.wiki.getTiddler(self.editTitle),
>> updateFields = {
>> title: self.editTitle
>> };
>> updateFields[self.editField] = value;
>> self.wiki.addTiddler(new
>> $tw.Tiddler(self.wiki.getCreationFields(),tiddler,updateFields,self.wiki.getModificationFields()));
>> };
>
>
> What does the function Tiddler? I suppose that it creates a new tiddler,
> but I don't understand the syntax.
> Is that the only way to update a Tiddler?
>
> If I just want to clear the mentioned values... can I use a simpler way?
> Something like
> if(clearTiddler)
> {
> var tiddler=this.wiki.getTiddler(clearTiddler);
> tiddler.fields.text="";
> }
>
>
> thanks in advance.
>
--
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.