-
31 Aug 2012 5:16 AM #1
Unanswered: set fieldtext value from sent data
Unanswered: set fieldtext value from sent data
hi, here is my problem :
i have a list of items in my navigationView, when "itemTap" i open a new panel where i need to display my Data.
i can succesfuly retrieve my sent data when i use "tpl:{ticketID}
but when i try to render the value on a textfield or label i can't, it render '{ticketID}' and not the value,
here is my code :
the controller :
Code:Ext.define('selfCare.controller.caseDetails',{ extend:'Ext.app.Controller', requires:['selfCare.view.CaseDetail'], config:{ refs:{ casesContainer:'casesContainer' }, control:{ 'casesContainer casesList':{ itemtap:function(list,index,target,record){ // console.log("ticket :"+ record.get('Ticketid')); var detailsView=Ext.create('selfCare.view.CaseDetail'); detailsView.setData(record.getData()); this.getCasesContainer().push(detailsView); } } } } });help meCode:Ext.define('selfCare.view.CaseDetail',{ extend:'Ext.Panel', xtype:'caseDetail', config:{ title:'details', //layout:'fit', styleHtmlContent:true, scrollable:'vertical', styleHtmlCls:'caseDetail', tpl:'{Ticketid} {Nature} ', items: [ { xtype: 'fieldset', //title: 'About You', //instructions: 'Tell us all about yourself', items: [ { xtype: 'textfield', readOnly: true, name: 'Ticketid', label: 'Ticket Id :' //value: {Ticketid} // does not work } ] } ] } });
-
2 Sep 2012 3:06 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
That only works within a template. To do what you want you will need to execute setValue on that field.
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 Sep 2012 4:18 PM #3
thank you for the answer, but i didnt get, how to use the setvalue in the "textfield" xtype,
what i have is a data{} sent from the previous panel when i tap on a listitem, how could i bind the data on diferent "textfields" of the second view ?!
-
18 Jan 2013 1:25 AM #4
Hi,
I'm new to sencha ,
Even m havin the same problem. Can you please shoe how to use setValue() in form.
Please!
-
18 Jan 2013 5:43 AM #5
If you have a data object
then callingCode:data: { name: 'Andrea', age: 29 }
ST will apply the values to the form fields which have the same "name" config param of your data.Code:myForm.setValues(data);
In this case, your form items should be:
Code:{ xtype: 'textfield', name: 'name' }, { xtype: 'numberfield', name: 'age' }Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
18 Jan 2013 6:31 AM #6


Reply With Quote