Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Date Picker Customization

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default Date Picker Customization

    Hi,
    I want to change the Datepicker component . Currently Extjs date picker is showing Month and year together and on click of next button it will go to next month . I need to change it , I want split year and month separately. And for year and month i need to implement previous and next functionality . Please help me out how i can achieve this . Please find the attached.
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Please give me the solution at the earliest .

  3. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    You will need to create a custom extension for this.
    There are no settings available for this by default.

    There are few other datepicker extensions in the Plugins/Extension forums where you can review some of the other extensions.

    If you are unable to do this, then you may have to contact someone at
    http://www.senchadevs.com/

    Scott

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Where actually this datepicker code lies . I am looking in Ext-all.js . In that file i didnt find any code . I need to look into the code .

  5. #5
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    The actual code is in /src/picker/Date.js

    You will want to create an extension and not modify Date.js or ext-all.js

    Scott.

  6. #6
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Why i should not change Date.js ?

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    It is better to create an extension than to modify the original source directly.

    Scott.

  8. #8
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    Ok . Thats fine . But still i have changed something in Date.js like i removed Today from the footer . But its not reflecting why its so ?

  9. #9
    Sencha User
    Join Date
    Jun 2012
    Posts
    29
    Vote Rating
    0
      0  

    Default

    I have created an extension of Date.js and that Xtype i am using . Its working . Thanks . Here one requirement is there like if we see the July month calendar in attachment the last row belongs to next month August , i dont want to show that row . If i look into Date.js file there numdays is intialized to 42 and its always creating 7 rows . If all the dates belongs to next month i dont want to show that row also . I think you got it . numdays should get intialize dynamically . please see the attachment.
    Attached Images Attached Images

  10. #10
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    So you understand the issue with Date.js ... this is the source code used to create our main distribution files (extjs-all.js, etc). If you where to recompile the code using our SDK, then the changes would be reflected. This is the reason for creating an extension/override when using the main lib.

    You can create a hard array for each month to determine the # days you want to display, or write a function to find the dom:
    http://www.electrictoolbox.com/javas...days-in-month/

    Scott.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •