PDA

View Full Version : MultiSelect and DataStore



Antjac
20 Aug 2009, 6:05 AM
Hi,

I'll like to use Multiselect with a datastore.
I use a query to show some users to add and I want to have the id value of the selected users.



win.EntretienCollectif.storeListCandidatsCollectif = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: '<?php echo $_SESSION['urlRoot']?>/includes/ajax/Ant/requetes.php',method: 'POST'}),
baseParams:{task: "readListCandidatsCollectif",antenneEnCours:<?php echo $_SESSION['id_Antenne'] ?> },
reader: new Ext.data.JsonReader({
root: 'rsCandCollectif',
totalProperty: 'totalCandCollectif',
id: 'id_Candidat' //the property within each row object that provides an ID for the record (optional)
}, [{name: 'id_Candidat'},{name: 'nomPrenCand'}])
});


This is my first Store



{
xtype: 'itemselector',
id: 'win.EntretienCollectif.selecCand',
imagePath: '<?php echo $_SESSION['urlRoot']?>/extjs/examples/ux/images/',
multiselects: [{
width: 250,
height: 150,
store: win.EntretienCollectif.storeListCandidatsCollectif,
displayField: 'nomPrenCand',
valueField: 'id_Candidat'
},{
width: 250,
height: 150,
store: [['10','Ten']],
tbar:[{
text: 'clear',
handler:function(){
Ext.getCmp('win.EntretienCollectif.selecCand').reset();
}
}]
}]
}

This is my selector

The problem is that I can't add user to the second list (It's normal, the first is a datastore and the second a simple array).

What can I do ?