Results 1 to 6 of 6

Thread: DatePicker - How to Hide the 'Today' Button

  1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    39

    Default DatePicker - How to Hide the 'Today' Button

    Hello,

    I have an application in which I use a DatePicker widget.

    In it, I set the minDate on tomorrow. So, to be logic, I want to disable the 'Today' button of the DatePicker or completely hide it.

    How can I do that ?

    Thank you

  2. #2
    Sencha Premium User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    888

    Default

    Hi. Well, from the DatePicker, you can get the todayBtn via jsni.
    Then, with that, you can call: todayBtn.abc.removeFromParent();

    Not sure if there is an easier way, but this should work.

    Regards,
    Michel.

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    39

    Default

    OK thank you for the reply.

    But, I don't really know how I can get the TodayBtn via jsni. I don't know how it works. Can you help ?

  4. #4
    Sencha Premium User
    Join Date
    Nov 2008
    Location
    Vienna - Austria
    Posts
    888

    Default

    PHP Code:
    private native Button getTodayBtn(DatePicker datePicker/*-{
            return [email protected]::todayBtn;
        }-*/


  5. #5
    Sencha User
    Join Date
    Feb 2010
    Posts
    39

    Default

    Ok. This method works fine. But when should I call it ? Should I add a listener to the DatePicker with the 'AfterRender' event ?

  6. #6

    Default

    use properties:

    showToday: false

    Example:
    {
    xtype: 'datefield',
    anchor: '100%',
    fieldLabel: 'From',
    name: 'from_date',
    showToday: false,
    maxValue: new Date() // limited to the current date or prior
    }

Similar Threads

  1. Disabling or hiding DatePicker today button [2.0.1]
    By halkon_polako in forum Community Discussion
    Replies: 5
    Last Post: 30 Oct 2008, 11:37 PM
  2. [2.0][FIXED] DatePicker Today button ?
    By prajith in forum Ext 2.x: Bugs
    Replies: 9
    Last Post: 9 Jul 2008, 10:51 PM
  3. Disable or Hide 'Today' Button
    By sanjshah in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 18 Feb 2008, 6:33 PM

Posting Permissions

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