Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3341 in a recent build.
  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    4
    Vote Rating
    0
    Slapshot is on a distinguished road

      0  

    Default 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
    Browser versions tested against:
    • Safari 5.1.7
    • Chrome 21.0.1180.83 m
    DOCTYPE tested against:
    • ____
    Description:
    • The date-picker doesn't fire the pick-event.
    Steps to reproduce the problem:
    • 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.
    The result that was expected:
    • A "Slot picked" output on the console.
    The result that occurs instead:
    • No output on the console
    Test Case:
    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.
    Code:
        
     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");
                                    }
                                }
                            }
                        }
                    ]
                }
            ];
        }
    });
    HELPFUL INFORMATION

    Debugging already done:
    • The DatePicker overrides the onSlotPick-function of Ext.picker.Picker but doesn't fire the pick-event.
    Possible fix:
    • Fire the pick-event in Ext.picker.Date.onSlotPick like in Ext.picker.Picker.onSlotPick.
    Additional CSS used:
    • only default sencha-touch.css
    Operating System:
    • Win 7 Professional
    Attached Files
    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"

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report!

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    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.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 2

Tags for this Thread