1. #1
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    214
    Vote Rating
    3
    bseddon is on a distinguished road

      0  

    Default Am I able to use prepareData?

    Am I able to use prepareData?


    When using ExtJS I am able to use the prepareData method to modify variables before they are applied to a template. The Touch dataview documentation indicates there is a prepareData method but when I create a 'Basic Function' as I do when using ExtJS the designer reports

    A valid function must have fn set. In addition, a function of a non top level component must match a configuration.
    Is it possible to use prepareData? Should I create an override?

    Thanks

  2. #2
    Sencha Premium Member
    Join Date
    Dec 2011
    Location
    London, UK
    Posts
    214
    Vote Rating
    3
    bseddon is on a distinguished road

      0  

    Default


    I answered my own question. The component must be promoted to a class.

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,185
    Vote Rating
    63
    aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice

      0  

    Default


    Yes, this is a departure from Ext JS, but is the only way that it is possible in Sencha Touch.

    (It's purposefully enforced that you can't override methods at the instance level)
    Aaron Conran
    @aconran
    Sencha Architect Development Team