parmarmayur9090 / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

How can I reset the date picker if I need to change the number of limits? #267

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have a dropdown box that allows the user to select "monthly", "semi monthly", 
"quarter monthly". Based on what the user selects, I change the numSelectable 
to either 1, 2, or 4. 

this works perfectly unless the user decides to change the dropdown selection. 
If the user changes the dropdown selection after he has already opened the date 
picker and selected a date then the original date is still there when the date 
picker is opened again. 

I am looking for a way to reset the date picker onchange of the selection.

Original issue reported on code.google.com by ceg93cli...@gmail.com on 11 Mar 2011 at 1:59

GoogleCodeExporter commented 8 years ago
Someone recently asked a similar question on Stack Overflow and got a decent 
answer:

http://stackoverflow.com/questions/5189805/kelvinluck-jquery-datepicker-multiple
-select

If you want to provide a patch with the changes against the latest version in 
SVN then I'll add it to the plugin...

Original comment by kelvin.l...@gmail.com on 11 Mar 2011 at 9:37

GoogleCodeExporter commented 8 years ago
thanks

I didn't use that method, but did use something similar.

Actually, you already had the functionality. I just added this to the rest of 
the db* functions.

        dbClearSelected : function()
        {
            return _w.call(this, 'clearSelected');
        },

all I do is if the dropdown box selection changes, I call this:

$('.date-picker').dbClearSelected();

I'm assuming this is all you need to patch the plugin.

Original comment by ceg93cli...@gmail.com on 12 Mar 2011 at 3:53

GoogleCodeExporter commented 8 years ago
Sorry - I misunderstood. I thought you were having problems changing 
numSelectable. Glad you have it figured out...

Original comment by kelvin.l...@gmail.com on 12 Mar 2011 at 8:21