If I have a store backed combobox selection that fires an event under ExtJS 4, how do I go about getting the full object that is represented by that selection?
In general, you can use the findRecordByValue
method on the 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...
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With