that sounds like a critical problem, but i dont understand what you are describing. please explain further. so far, i appear to be iteratively setting the .rec property to the current records right before executing the template pseudocode for that record, which seems to be working.
If you are using MVC then logic should be in the Controller or a Utility class, the model just has data and the Controller or Utility class would act on that data.
i see. i am using MVC and consider it a very useful design paradigm.
i am still concerned by your statement
so don't rely on the data being correct.
would you mind clarifying how the data could be incorrect?
regarding MVC, i think i have still maintained an MVC approach. Lists are already aware that Models exist and have dependency on the store and model classes, they are just agnostic to the Model design. both the List and Template provide a simple iteration facility and already pass data instances to overridable iterative methods.
the one missing piece, as far as i can tell, is that the List supplies ONLY the data from the Model and not the Model itself to the template. is this to prevent potential memory leaks? as in, a template might hold on to a Model reference too long? do compiled templates get fully cleaned up along with any references? if you wouldnt mind sharing more about that, i would appreciate it. right now, memory leaks are my largest concern, aside from your statement about incorrect data.
by they way, i am a big fan of sencha's design. especially 2.0. the better i understand it the more i love it.
I started using this solution, too. It's a shame that Ext doesn't support access to the record from within the template by default — I agree with pyoungerv that it would help code organization to be able to consolidate all useful instance methods within the Model definition.
Interesting solution.. I'm trying to find my way around the same problem now.
I've been thinking about re-implementing templating for DataViews with an extension or override that would let you something like Handlebars templates with access to the model instance for the record instead of being forced to use the bizarre XTemplate implementation. I'll post in the thread again once I have something to show!
For now, I'll stick methods in the template instance .