NetNexus
10 Mar 2011, 10:52 AM
If an item is selected by a mouse drag the pick-event is fired, if it is chosen by a click no event is fired.
I use the following code as a workaround:
Ext.override(Ext.Picker.Slot, {
setSelectedNode: function(selected, animate) {
// If it is a number, we assume we are dealing with an index
if (Ext.isNumber(selected)) {
selected = this.getNode(selected);
}
else if (selected.isModel) {
selected = this.getNode(this.store.indexOf(selected));
}
// If its not a model or a number, we assume its a node
if (selected) {
this.selectedNode = selected;
this.selectedIndex = this.indexOf(selected);
this.scrollToNode(selected, animate);
}
this.fireEvent('slotpick', this, this.getValue(), this.selectedNode);
}
});
(I just added the last line of the method)
I use the following code as a workaround:
Ext.override(Ext.Picker.Slot, {
setSelectedNode: function(selected, animate) {
// If it is a number, we assume we are dealing with an index
if (Ext.isNumber(selected)) {
selected = this.getNode(selected);
}
else if (selected.isModel) {
selected = this.getNode(this.store.indexOf(selected));
}
// If its not a model or a number, we assume its a node
if (selected) {
this.selectedNode = selected;
this.selectedIndex = this.indexOf(selected);
this.scrollToNode(selected, animate);
}
this.fireEvent('slotpick', this, this.getValue(), this.selectedNode);
}
});
(I just added the last line of the method)