1. #21
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    Answers
    3102
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    I would think that is only going to allow you to use one record so don't rely on the data being correct.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  2. #22
    Sencha User
    Join Date
    Aug 2010
    Posts
    17
    Vote Rating
    1
    pyoungerv is on a distinguished road

      0  

    Default


    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.

  3. #23
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    Answers
    3102
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #24
    Sencha User
    Join Date
    Aug 2010
    Posts
    17
    Vote Rating
    1
    pyoungerv is on a distinguished road

      0  

    Default


    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.

  5. #25
    Sencha User
    Join Date
    May 2009
    Posts
    8
    Vote Rating
    0
    gjuggler is on a distinguished road

      0  

    Default


    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.

  6. #26
    Sencha User
    Join Date
    May 2012
    Posts
    1
    Vote Rating
    0
    anthonyroldan is on a distinguished road

      0  

    Default


    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 .

Tags for this Thread