1. #1
    Sencha User
    Join Date
    Aug 2012
    Location
    India
    Posts
    31
    Answers
    2
    Vote Rating
    5
    kanchan@rhytha.co.in is on a distinguished road

      1  

    Default Answered: Date Picker not populating after override Expand method.

    Answered: Date Picker not populating after override Expand method.


    Hi,

    I wanted to set different date in date picker by replacing default date of date picker that comes system date.
    for that i override Date field - below is my code -

    Date picker.png

    Now i was expecting myDate as default in picker.
    But picker is not populating when i click on picker to select date it showing error -

    "TypeError: date.getTime is not a function" .

    Also i tried - new Date() in place of myDate.

    Please let us know what's wrong with my code?

    Thank you.

  2. You override a base functionality, and of course it's stoped works.
    Code below it's a code of expand( ) method.
    I think at least you need call me.fireEvent('expand', me); and picker.show(); or copy all code of base method and add your code .
    But you can use not override method , you can define "expand" method in your components then add your functionality and call this.callParent() function.
    Code:
    expand: function() {
            var me = this,            bodyEl, picker, collapseIf;        if (me.rendered && !me.isExpanded && !me.isDestroyed) {            bodyEl = me.bodyEl;            picker = me.getPicker();            collapseIf = me.collapseIf;            // show the picker and set isExpanded flag            picker.show();            me.isExpanded = true;            me.alignPicker();            bodyEl.addCls(me.openCls);            // monitor clicking and mousewheel            me.mon(Ext.getDoc(), {                mousewheel: collapseIf,                mousedown: collapseIf,                scope: me            });            Ext.EventManager.onWindowResize(me.alignPicker, me);            me.fireEvent('expand', me);            me.onExpand();         }

  3. #2
    Sencha User
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    34
    Answers
    2
    Vote Rating
    4
    Ilay is on a distinguished road

      0  

    Default


    Check format : String property of your picker

  4. #3
    Sencha User
    Join Date
    Aug 2012
    Location
    India
    Posts
    31
    Answers
    2
    Vote Rating
    5
    kanchan@rhytha.co.in is on a distinguished road

      0  

    Default


    Hi,

    I checked with date format and

    I have changed my code according to error - "TypeError: date.getTime is not a function" .

    For that i converted date string to date-time as below -

    var myDate = new Date("08/07/2013");

    Now error is stopped but picker still not populating.


  5. #4
    Sencha User
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    34
    Answers
    2
    Vote Rating
    4
    Ilay is on a distinguished road

      1  

    Default


    You override a base functionality, and of course it's stoped works.
    Code below it's a code of expand( ) method.
    I think at least you need call me.fireEvent('expand', me); and picker.show(); or copy all code of base method and add your code .
    But you can use not override method , you can define "expand" method in your components then add your functionality and call this.callParent() function.
    Code:
    expand: function() {
            var me = this,            bodyEl, picker, collapseIf;        if (me.rendered && !me.isExpanded && !me.isDestroyed) {            bodyEl = me.bodyEl;            picker = me.getPicker();            collapseIf = me.collapseIf;            // show the picker and set isExpanded flag            picker.show();            me.isExpanded = true;            me.alignPicker();            bodyEl.addCls(me.openCls);            // monitor clicking and mousewheel            me.mon(Ext.getDoc(), {                mousewheel: collapseIf,                mousedown: collapseIf,                scope: me            });            Ext.EventManager.onWindowResize(me.alignPicker, me);            me.fireEvent('expand', me);            me.onExpand();         }

  6. #5
    Sencha User
    Join Date
    Aug 2012
    Location
    India
    Posts
    31
    Answers
    2
    Vote Rating
    5
    kanchan@rhytha.co.in is on a distinguished road

      1  

    Default


    Hi Ilay,

    Thank for your answer it work by some modification .. we don't need - me.onExpand(); last line of code becoz it reset date to current date.

    I was looking in datefield expand event before that not in picker expand field.


    Thank you very much.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi