1. #1
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    rajakrishnamca is on a distinguished road

      0  

    Default Problem Date picker

    Problem Date picker


    Hi to all,

    i am new to extjs...

    i worked in the example of grid/mysql/php, it works fine.

    if user edit the datefield and choose the date picker ,its save in db as fine


    i want like this...
    if user unselect the date ...its default take the current date and insert in db


    help me



    sorry for my bad english

    Thnks in advance

  2. #2
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891
    Vote Rating
    9
    wm003 will become famous soon enough

      0  

    Default


    if you try DatePickerPlus, you will have an additional event called "afterdateclick" which delivers the clicked date (of course) and the state (selected or unselected). (useful for multiselection)

    For single selection you can try the "select" event to recognize a date-change and update your database.

    See first post of DatepickerPlus for full API Docs.

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    3
    Vote Rating
    0
    rajakrishnamca is on a distinguished road

      0  

    Default Problem Datepicker

    Problem Datepicker


    hi thanks for your kind help. That link was more helpful to me but still i could nt get proper result. will you please provide me a sample code.



    please help me

  4. #4
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891
    Vote Rating
    9
    wm003 will become famous soon enough

      0  

    Default


    Quote Originally Posted by rajakrishnamca View Post
    hi thanks for your kind help. That link was more helpful to me but still i could nt get proper result. will you please provide me a sample code.
    considering you use datepickerplus, a config for a Datefield could look like this:

    PHP Code:
    {
                
    xtype'datefieldplus',
                
    listeners:{
                     
    'afterdateclick':function(dp,date,state){
    /*
    do something here
    dp --> the datepickerobject
    date --> the date the user clicked on
    state=true --> date was selected
    state=false --> date was unselected
    */
                     
    }
                } ,
                
    multiSelection:true,
                
            }, 
    This should be a good start.

    You can look at several examples of DatePickerPLus here

Thread Participants: 1