-
17 Feb 2012 7:24 AM #1
Unanswered: Ext.field.Select using Store
Unanswered: Ext.field.Select using Store
I've got a question; when I reload a store that is being used by an Ext.field.Select object, it fires the "change" event, even though the user hasn't selected a new option. I was wonder if there was a way to avoid the Select field from selecting the first item, or is there some other listener that I'm missing which would be more like a "select" event?
No longer a Newbie
-
17 Feb 2012 8:00 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
You would have to override the Select field to do that. It is at the end of the showPicker method:
Code:showPicker: function() { //check if the store is empty, if it is, return if (this.getStore().getCount() === 0) { return; } if (this.getReadOnly()) { return; } this.isFocused = true; //hide the keyboard //the causes https://sencha.jira.com/browse/TOUCH-1679 // Ext.Viewport.hideKeyboard(); if (this.getUsePicker()) { var picker = this.getPhonePicker(), name = this.getName(), value = {}; value[name] = this.record.get(this.getValueField()); picker.setValue(value); if (!picker.getParent()) { Ext.Viewport.add(picker); } picker.show(); } else { var listPanel = this.getTabletPicker(), list = listPanel.down('list'), store = list.getStore(), index = store.find(this.getValueField(), this.getValue(), null, null, null, true), record = store.getAt((index == -1) ? 0 : index); if (!listPanel.getParent()) { Ext.Viewport.add(listPanel); } listPanel.showBy(this.getComponent()); list.select(record, null, true); }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Feb 2012 6:17 AM #3
Thanks for the response. I was wondering, is it possible to accomplish what you're suggesting with a sequence process? I'm a litltle leary of overriding the entire method.
No longer a Newbie


Reply With Quote