-
24 Oct 2012 6:47 AM #1
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:
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.Code:activateListView: function (record) { var listaView = this.getListaView(); listaView.setRecord(record); Ext.Viewport.animateActiveItem(listaView, this.slideLeftTransition); },
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.
-
Best Answer Posted by mitchellsimoens
If you have the tpl config set on the component the data will be applied to the tpl.
-
26 Oct 2012 6:14 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,666
- Vote Rating
- 435
- Answers
- 3110
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.
-
15 Nov 2012 8:55 PM #3
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'});
-
16 Nov 2012 12:25 AM #4Sencha Premium Member
- Join Date
- Feb 2012
- Location
- Berne, Switzerland
- Posts
- 584
- Vote Rating
- 32
- Answers
- 35
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
-
16 Nov 2012 8:54 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,666
- Vote Rating
- 435
- Answers
- 3110
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.
-
16 Nov 2012 5:24 PM #6


Reply With Quote