PDA

View Full Version : Compositefield and Container problem



SabaSarwat
11 Nov 2010, 10:57 PM
I had some compositefields and i wanted to load date in them on 'render' event. But setValues() was not working in this regards.
I followed these threads http://www.sencha.com/forum/showthread.php?115203-BasicForm-setValues()-doesn-t-play-nice-with-compositefield&highlight=compositefield+setValues()
http://www.sencha.com/forum/showthread.php?96487-Load-form-on-render-event-but-CompositeField-not-rendered-yet.&highlight=compositefield+setValues() and assumed that i should use xtype: 'container' and layout: 'hbox' to fix this issue.
That helped to solve my problem of data loading, but now i have two issue in it as well...
1: itemCls is not working
2: there is no space between different textfield as it was in compositefield
I tried to solve this problem via padding and margin but it did not help bringing the space between items.
Code snippet is given:



items: [{
xtype : 'container',
layout: 'hbox',
items : [ {
xtype : 'displayfield',
width: 250,
value:'Body Parts'
}, {
xtype : 'checkboxgroup',
name: 'P',
submitValue: true,
flex:1,
columns : 3,
items : [{
boxLabel : 'Shoulder',
name : 'P1',
inputValue : 1
},{
boxLabel : 'Arm',
name : 'P2',
inputValue : 2
}, {
boxLabel : 'Hand',
name : 'P3',
inputValue : 3
}]
}]
},{
xtype : 'container',
layout: 'hbox',
flex: 1,
items : [{
xtype:'displayfield',
width: 250,
value : 'Side Details',
hideLabel : true
},{
xtype:'textfield',
name:'Left',
emptyText : 'Left Side',
flex : 1
},{
xtype:'textfield',
name: 'Right',
emptyText : 'Right Side',
flex : 1
}]
}]


kindly tell me why is it happening? and where am i mistaken?
Regards,
Saba!