View Full Version : xtemplate member functions in Sencha Designer
20 Feb 2012, 3:57 AM
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.
20 Feb 2012, 7:18 AM
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.
20 Feb 2012, 7:24 AM
I see. Where should I do that then? In the Application launch method?
20 Feb 2012, 7:31 AM
Ya, that's where I'd do it
20 Feb 2012, 7:33 AM
20 Feb 2012, 7:48 AM
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
I have the same problem any suggestions?
7 Jun 2012, 12:22 PM
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.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.