1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    1
    Vote Rating
    0
    bojanr is on a distinguished road

      0  

    Default Answered: How to pass data other than through setrecord

    Answered: How to pass data other than through setrecord


    In my controller I have this function:

    Code:
    activateListView: function (record) {
            var listaView = this.getListaView();
            listaView.setRecord(record);
            Ext.Viewport.animateActiveItem(listaView, this.slideLeftTransition);
        },
    I know setRecord is used for form fields...but is there any way I could pass the data so it can be used in html or in the title? I know setRecord works only when used in 'name' config on a textfield, but I need it in title or in html, e.g. html: [ Title: {title} ]. Hope I'm not too confusing.

    P.S.

    activateListView function is used on itemtap in a list... what I'm trying to achieve is get data for one item from the list in a separate view.

  2. If you have the tpl config set on the component the data will be applied to the tpl.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,693
    Vote Rating
    435
    Answers
    3111
    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


    Code:
    comp.setData(record.getData())
    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. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    9
    Vote Rating
    0
    Deepindera is on a distinguished road

      0  

    Default


    Now, how to consume this data in the view ?
    HTML Code:
         var detail = this.getNoticeDetail();        detail.setData(record.getData());              Ext.Viewport.animateActiveItem(detail,{ type: 'slide', direction: 'left'});

  5. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    584
    Vote Rating
    32
    Answers
    35
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    Quote Originally Posted by Deepindera View Post
    Now, how to consume this data in the view ?
    f.e. you listen for a data change in the view and then you do there what needs to be done.
    http://docs.sencha.com/touch/2-1/#!/...ent-updatedata

  6. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,693
    Vote Rating
    435
    Answers
    3111
    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 have the tpl config set on the component the data will be applied to the tpl.
    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.

  7. #6
    Sencha User
    Join Date
    Oct 2012
    Posts
    9
    Vote Rating
    0
    Deepindera is on a distinguished road

      0  

    Default


    cheers, that works