eratech
Posts: 513
|
Posted: 03/03/2014, 11:47 PM |
|
Building an Event tracking system for a client - conferences, training, classes etc.
Client requested that when the 'Event Start' date is selected using the inline datepicker, that the 'Event End' date default to the start date, so that they aren't clicking through months of future dates to set the fields.
After considering how to override the CCS datepicker options, I found that you can pass the normal jquery datepicker through with the CCS options.
The example below has the normal CCS options ('dateFormat','isWeekend') and I edited it with the additional jquery-ui option 'altField' which if set will put the selected value into this field as well, and for fun, the 'minDate' option so you cannot start things more than a couple of days ago.
//Feature Parameters @1-FBACC53D
params["eventsdate_startInlineDatePicker1"] = {
dateFormat: "d/MM/yyyy",
isWeekend: true
, altField: "#eventsdate_end"
, minDate: -2
};
//End Feature Parameters
/** this is where CCS binds the datepicker and passes in the params from above **/
//Feature Init @1-F75AE43A
features["eventsdate_startInlineDatePicker1"].ccsBind(function() {
this.ccsDateTimePicker(params["eventsdate_startInlineDatePicker1"]);
});
//End Feature Init
And if you need to mirror the date into 2 other fields instead of one? just list them, comma delimited, in the 'altField':
, altField: "#eventsdate_end,#eventsdate_bookings_close"
As the built-in CCS datepicker is a jquery plug-in, so you can probably use just about all the normal jquery-ui options if you need to.
Hope this helps someone else.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |