-
20 Feb 2012 3:57 AM #1
xtemplate member functions in Sencha Designer
xtemplate member functions in Sencha Designer
Hello all,
How can I create a member function to use with an xtemplate?
I'm defining this xtemplate directly in a list. I tried using scope:this, but it doesn't work, I guess this is because the xtemplate is being implemented directly in the base class... All I really need is to be able to define a member function to use in the xtemplate.
P.s. I'm using Sencha Touch.
Thanks.
-
20 Feb 2012 7:18 AM #2
It's not currently possible. What i would recommend as a workaround would be to add a function to the standard set of Ext.util.Format functions and then invoke that method.
Aaron Conran
@aconran
Sencha Architect Development Team
-
20 Feb 2012 7:24 AM #3
I see. Where should I do that then? In the Application launch method?
Thanks
-
20 Feb 2012 7:31 AM #4
Ya, that's where I'd do it
Aaron Conran
@aconran
Sencha Architect Development Team
-
20 Feb 2012 7:33 AM #5
-
20 Feb 2012 7:48 AM #6
Another idea... Is it possible to define the xtemplate by hand and then apply it to the list? That would solve the formatting function problem, or am I missing something?
-
5 Jun 2012 12:43 PM #7
-
7 Jun 2012 12:22 PM #8
Aaron,
I have a similar situation. I have a View defined with tpl that renders some text and then two hyperlinks (Edit and Delete) for each row of data. When either of the two hyperlinks are clicked, I would like to fire one of my custom events for that View control. Can you please provide some sample code of how this can be accomplished using your suggested workaround? I have my onclick handlers in place to catch the hyperlink clicks, but am not sure how to structure the other part.
Thanks!


Reply With Quote