PDA

View Full Version : panel with textfield with the same name



Moinsen
24 Jul 2012, 4:57 AM
Hi,

i am looking for a way to display the same field in multiple textfields in a panel.
The panel has the following items (example):



items: [{
xtype: 'textfield',
fieldLabel: 'Name',
name: 'name'
},{
xtype: 'textfield',
fieldLabel: 'Name2',
name: 'name'
},{
xtype: 'textfield',
fieldLabel: 'Name3',
name: 'name'
},{
xtype: 'textfield',
fieldLabel: 'Name5',
name: 'name'
},{
...


Just the first textfield displays the content from the record. What is necessary to show the content from the record in all textfields. And what is best to bind all these textfields. So if i change the content in one field all the other fields must be updated?

Thank you!

Tim Toady
24 Jul 2012, 7:29 AM
I can't think of a use case where what you are attempting makes any sense. Why do you need multiple textfields for the same thing? You would just need a listener to update the other fields, but are you sure that is what you want?

scottmartin
24 Jul 2012, 8:41 AM
Perhaps a calculated field using convert?
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Field-cfg-convert

Scott.