Si j'ai une sélection de combobox sauvegardée en magasin qui déclenche un événement sous ExtJS 4, comment puis-je obtenir l'objet complet qui est représenté par cette sélection ?
Réponses
Trop de publicités?En général, vous pouvez utiliser le findRecordByValue
sur la combobox :
combobox.on('change', function(combobox, newValue, oldValue) {
// Get the old and the new records.
// NOTE: The underlying store is not guaranteed to
// contain an associated record.
var oldRecord = combobox.findRecordByValue(oldValue);
if (oldRecord) {
// Do something...
}
var newRecord = combobox.findRecordByValue(newValue);
if (newRecord) {
// Do something...
}
});
James McMahon
Points
14356