-
24 Aug 2012 12:38 AM #1
Ext.picker.Date fires no pick-event
Ext.picker.Date fires no pick-event
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.1.1
- Safari 5.1.7
- Chrome 21.0.1180.83 m
- ____
- The date-picker doesn't fire the pick-event.
- Use a Ext.field.DatePicker in a form.
- In the "picker"-config, add a listener to the pick-event.
- Just do a console.log("Slot picked") in the listener-function.
- A "Slot picked" output on the console.
- No output on the console
This code is based on the forms-example in the sencha-touch-2.0.1.1-package.
I also added a show-listener to varify, that the picker fires events at all.
A fully functional test-case including index.html, sencha-touch-all.js and sencha-touch.css is attached.
HELPFUL INFORMATIONCode:Ext.application({ launch: function() { var items = this.getFormItems(), config, form; config = { xtype: 'formpanel', items: items }; form = Ext.Viewport.add(config); this.form = form; }, /** * This method returns an array of all items we should add into the form panel we create above in our launch function. * We have created this function to simply make things cleaner and easier to read and understand. You could just put these items * inline up above in the form `config`. * @return {Array} items */ getFormItems: function() { return [ { xtype: 'fieldset', title: 'Personal Info', instructions: 'Please enter the information above.', defaults: { required: true, labelAlign: 'left', labelWidth: '40%' }, items: [ { xtype: 'datepickerfield', name: 'date', label: 'Start Date', value: new Date(), picker: { yearFrom: 1980, listeners: { show: function() { console.log("Picker shown"); }, pick: function(){ console.log("SLot picked"); } } } } ] } ]; } });
Debugging already done:- The DatePicker overrides the onSlotPick-function of Ext.picker.Picker but doesn't fire the pick-event.
- Fire the pick-event in Ext.picker.Date.onSlotPick like in Ext.picker.Picker.onSlotPick.
- only default sencha-touch.css
- Win 7 Professional
Last edited by Slapshot; 24 Aug 2012 at 1:01 AM. Reason: Found the reason for this bug after further investigation. Updated "Debugging already done" and "Possible fix"
-
24 Aug 2012 6:17 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
Thanks for the report!
-
27 Aug 2012 12:02 PM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
This has been fixed and will be in the 2.1.0-b3 release.
2 changes: onSlotPick method in the picker.Date now calls it's parent method and we no longer fire 'slotpick' on the tap event since onScrollEnd does this as well.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3341
in
Sprint 24 (2.1.0-b3).


Reply With Quote