Ok,
It was pretty easy
/*
The edit-text widget calls this method just after inserting its dom nodes
*/
EditTextWidget.prototype.postRender = function() {
var self = this;
var domNode = self.domNodes[0];
$tw.utils.addEventListeners(domNode,[
{name: "keydown", handlerObject: this, handlerMethod: "insertAtCursor"}
]);
};
WOW! New plugin upcoming....
El viernes, 18 de abril de 2014 17:21:43 UTC+2, Danielo Rodríguez escribió:
>
> Hello Jeremy,
>
> Forget about that, you're right.
>
> What I want is to extend the edit-text widget using the postRender
> function. I have my code ready to go. I just want to know how properly
> extend the widget adding an event listener to the text area domnode.
>
> I think I can access this.domnodes but I'm not sure how.
>
>
>
> El viernes, 18 de abril de 2014 13:26:09 UTC+2, Jeremy Ruston escribió:
>>
>> Hi Danielo
>>
>>>
>>> There are several examples of how create child widgets, refresh them,
>>> append them to the domnode... But how can I access and modify the content
>>> of any child widget inside my widget?
>>>
>>
>> A widget should not reach into its child nodes to manipulate them
>> directly. You have to do things more indirectly: your widget can modify
>> tiddlers or variables, either of which can be used to trigger the updating
>> of the child widgets.
>>
>> If you can describe a use case a little I may be able to advise on
>> alternative approaches,
>>
>> Best wishes
>>
>> Jeremy
>>
>>
>>
>>
>>>
>>> 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.
>>>
>>
>>
>>
>> --
>> Jeremy Ruston
>> mailto:[email protected]
>>
>
--
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.