JQuery Datepicker Control

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/26/2010 2:52:02 PM
Gravatar
Total Posts 131

JQuery Datepicker Control

I have started implementing the new jquery datepicker control and have a couple of questions.

1) I see that if you set enabled to false you disable the text box but still allow users to update the date. That is the behavior I want, but unfortunately is applies the disabled style to the button, so it may be confusing to the user. Any way to get the text box to be disabled but have the calendar launch whenever someone clicks the text box?

2) How do I set the time interval? I would like mine to be every 15 minutes and remove the time slider. Are there options for this?

Thanks in advance for any help.

 

11/26/2010 8:17:21 PM
Gravatar
Total Posts 131

Re: JQuery Datepicker Control

I looked into this further. Unfortunately, the time increments and slider are hardcoded into the js file. So direct modification of the js file is needed to allow for different times.

Also, setting enable to false prevents correctly reading the value after postback. The better way is to update the jDatePicker.cs file and change the showOn value in the setup script from 'button' to both - this makes the calendar popup upon entry into the text field. Although users can still change the text and cause it to fail validation. So you also need to change the constrainInput to 'True.' This prevents users from entering text into the textbox and forces them to use the calendar and date control.

Hope this helps.

 

 

11/27/2010 5:49:05 AM
Gravatar
Total Posts 18439

Re: JQuery Datepicker Control

Hi David,

If you get the latest code I've exposed a few more properties on jDatePicker.cs to allow you to configure the showOn, constrainInput, and also it is now possible to configure an image for the button.

However, I kept the default behavior as it was. One problem with using showOn=both and/or constrainInput=true is that it does not allow you to leave the field blank like when you have a begin date and end date and you want to leave end date blank so there is no end date.

So we need to use it in a variety of situations in mojoPortal and the default settings are designed to make it meet those diverse needs. We are also somewhat constrained by our DatePicker wrapper control and provider model that allows plugging in different date pickers, this makes us have to use a common api exposing only the most common date picker properties on the control and it is difficult to expose all the various properties of a particular underlying datepicker. In your custom features you can of course use the jDatePicker.cs directly instead of using our wrapper control so you can have more control over properties available on the control.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.