7 Sep 2012 8:52 PM #1
Best way to debug XTemplates? Illuminations?
I'm working with XTemplates and they are proving hard to debug, specially with the conditional operators etc. To give an example, I was trying something with the for construct and I kept getting non-helpful exceptions or in some cases it kept failing silently (nothing got printed). I'm sure the issue was with my code and I later worked around it with the switch construct.
What is the best way to debug XTemplates? Can I see the generated code to help get some hints about where I may be going wrong? Will something like Illuminations help?
7 Sep 2012 10:02 PM #2
The text of an XTemplate gets translated into a function, so the best way to see if that is what you had hoped is to step into the apply or applyOut method and then into the call to the "fn" method it has created.
In Chrome, you can even pretty up the function code, but it is not too far from readable without assistance.
Feel free to post an example of what you are trying to debug - someone may be able to point out issues on simple inspection.-->
7 Sep 2012 10:04 PM #3
I guess I should have clarified that the above is true on Ext JS 4.1 + but it sounds like that is what you are using from your mention of "switch".-->
8 Sep 2012 3:59 AM #4
Thanks Don, I'll give it a try. Will reopen the thread if needed.-->