PDA

View Full Version : Itemselector : select all



yegortitov
27 Jul 2009, 11:19 PM
Hi everyone,

i try to add a button "Select All" in a field ItemSelector.

My code is :



{
xtype: 'itemselector',
name: 'items',
fieldLabel: 'Items *',
imagePath: '../ux/images/',
multiselects: [{
width: 300,
height: 250,
store: store1,
displayField: 'text',
valueField: 'value',
tbar:[{
text: 'Select All',
handler:function(){
fp.getForm().findField('items').setValue('1,2,3');
}
}]
},{
width: 300,
height: 250,
store: store2,
displayField: 'text',
valueField: 'value',
tbar:[{
text: 'Effacer',
handler:function(){
fp.getForm().findField('items').reset();
}
}]
}]
}
But it doesn't work.

Is this a way to do that ?

Thanks

Antjac
27 Nov 2009, 1:38 AM
{
xtype: 'itemselector',
name: 'items',
fieldLabel: 'Items *',
imagePath: '../ux/images/',
multiselects: [{
width: 300,
height: 250,
store: store1,
displayField: 'text',
valueField: 'value',
tbar:[{
text: 'Select All',
handler:function(){
fp.getForm().findField('items').fromMultiselect.view.selectRange(0,yourstore.getCount());
}
}]
},{
width: 300,
height: 250,
store: store2,
displayField: 'text',
valueField: 'value',
tbar:[{
text: 'Effacer',
handler:function(){
fp.getForm().findField('items').reset();
}
}]
}]

}