Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    hazarathk is on a distinguished road

      0  

    Default Customize DatePicker

    Customize DatePicker


    I'm trying to customize the existing datepicker (com.sencha.gxt.widget.core.client.DatePicker) (GXT3.0.1). Ex: Hiding the today button. I've tried to duplicate the DatePicker class to customize, but it didn't worked out. Please suggest the better approach

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    I've tried to duplicate the DatePicker class to customize, but it didn't worked out.
    What did you try, exactly? What about it didn't work - was it just that it needed some changes, or is it no longer possible to subclass the DatePicker?

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    hazarathk is on a distinguished road

      0  

    Default


    I want to hide 'Today' button in DatePicker. For that I've created an object to DatePicker in my class and tried to hide it by using css. But not getting how to hide component inside component (i.e.,today button).
    2nd approach: Copied the entire DatePicker code along with all the related API classes to my local and tried to customize it. But it is giving 'Deffered binding exception'. Seems I missed something to inherit.

    Could you please suggest me the good approach apart from these.

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Subclass it, and set todayBtn.setVisible(false)?

    Make a new appearance implementation with a) todayButtonSelector() pointing at an invisible element, and b) the space normally used for that region collapsed?

    These are the first two options I thought of - both look reasonable. If you have problems, please actually share the *code* you are writing - I can't tell if your CSS doesn't work because what you wrote doesn't make sense or if there is a problem with changing it with CSS.

  5. #5
    Sencha User
    Join Date
    Dec 2012
    Posts
    4
    Vote Rating
    0
    hazarathk is on a distinguished road

      0  

    Default


    Thanks Colin. Now I'm able to hide today button. Could you please let me know how to hide leftmonthSelector as it is not declared in Datepicker class as 'protected TextButton todayBtn; '.
    Not getting where it is declared.

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    You really aren't giving me a lot to go on - the problem changes and gets more complex every post. That's fine if you were actually reading the code that I'm pointing you at, but you seem to just be waiting for me to do it for you.

    The second option I gave in the last post is what you want if you are further customizing the datepicker - start with the appearance object, and remove pieces you don't need.

Thread Participants: 1

Tags for this Thread