Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    4
    Vote Rating
    0
    jmchawkins is on a distinguished road

      0  

    Default Ext.form.DatePicker field value != getValue after reset() called

    Ext.form.DatePicker field value != getValue after reset() called


    When clearing the value of Ext.form.DatePicker using the reset() method the getValue() method always returns the last selected date while the UI correctly displays a cleared text field. (Tested with Chrome desktop browser 26.0.1410.64 m)

    var formField = null;


    Ext.setup({onReady: CreateScreen});


    function CreateScreen() {
    var currentYear = new Date().getFullYear();
    formField = new Ext.form.DatePicker({
    picker: {
    yearFrom: currentYear - 10,
    yearTo: currentYear + 10,
    value: { day: 1, month: 1, year: currentYear }
    }
    });


    Ext.create('Ext.Container', {
    fullscreen: true,
    items: [formField,
    {
    xtype: 'button',
    text: 'clear',
    handler: function (btn, e, eOpts) {
    formField.reset();
    alert('field = ' + formField._value + '; getValue returns ' + formField.getValue() );
    }
    }]
    });
    }
    Last edited by jmchawkins; 30 Apr 2013 at 7:34 AM. Reason: include browser version

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Vote Rating
    855
    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


    What ST 2.x.x version are you using? Have you tested in 2.2.0?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    4
    Vote Rating
    0
    jmchawkins is on a distinguished road

      0  

    Default version 2.1

    version 2.1


    I am using 2.1 and I haven't tried it in 2.2. I will try post my result.

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    4
    Vote Rating
    0
    jmchawkins is on a distinguished road

      0  

    Default works in 2.2

    works in 2.2


    works in 2.2

Thread Participants: 1