DatePicker - how to get it working ?

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.
1/3/2012 11:51:56 PM
Gravatar
Total Posts 42

DatePicker - how to get it working ?

Hi Guys

i'm having some problems identify which datepicker control to use. There seems to be quite a bit in the forums but nothing that would give me a good starting point.  It seems there is no documentation related to this type of controls.

i have being trying to replicate something along the lines on this page : http://www.mojoportal.com/mojoportal-2348-released.aspx.

I've looked at the blog edit function and copied the control to my clean custom control, All I get is a standard input box with no drop down calander . I did not include another code apart form the setting of the date/time itself.

questions:

1) does someone have a simple clean example (code) of a working date picker page/control

2) do i need to include and JS script in the code ? ( ie using the append function)

3) is there any documentation for the datepicker ?

 

 

Thanks

Lee B

1/4/2012 9:15:12 AM
Gravatar
Total Posts 18439

Re: DatePicker - how to get it working ?

Hi Lee,

The blog is a good place to get example code for this, however our time picker has changed since that blog post you linked to, you can see the newer version in this blog post.

Bascially you just add it to your control like this:

<mp:DatePickerControl ID="dpBeginDate" runat="server" ShowTime="True" SkinID="blog" CssClass="forminput">
</mp:DatePickerControl>

Note that the tag mapping for <mp: needs to be in the <pages><controls> section of the Web.config file in your custom feature project like this:

<add tagPrefix="mp" namespace="mojoPortal.Web.Controls" assembly="mojoPortal.Web.Controls"/>

and you need a reference to the mojoPortal.Web.Controls project.

You don't need to include any script that is handled by the control. Note that it is designed to run in the context of mojoPortal not in a free standing separate web app. ie I assumme you are developing your custom feature according to our examples such that your code is in your own project and is copied up to the Web folder by a post build event so that it runs in the same web app as mojoPortal. See the Building a Guestbook Series of Videos to learn more about how to structure your project and solution.

Hope that helps,

Joe

1/4/2012 7:41:18 PM
Gravatar
Total Posts 42

Re: DatePicker - how to get it working ?

Hi Joe

Thanks for your quick help ... its now working.

I had prevoiusly followed your developer videos and had set up my dev environment as per the video  and i have developing multiple custom controls etc.

the only thing that i changed was the control ie "<mp:DatePickerControl ID="dpBeginDate" .........."

Note; The new datepicker looks great

thanks

Lee

1/6/2012 9:45:37 AM
Gravatar
Total Posts 87

Re: DatePicker - how to get it working ?

Hi,

have similar problem - got standard input box without calendar. But in my case i have project on my development machine and it is version 

2.3.6.7 MSSQL
Operating System Microsoft Windows NT 6.1.7600.0
ASP.NET Info v4.0.30319 Running in Full Trust

on production server i upgraded mojoportal version and it is now 

2.3.7.5 MSSQL
Operating System Microsoft Windows NT 5.2.3790 Service Pack 2
ASP.NET Info v4.0.30319 Running in Full Trust

it was working on production (i think) before i upgarded, but now it stopped working (i checked it works on blog edit ) on my custom control. 

I checked webconfig for <add tagPrefix="mp" namespace=".... 

everything seem to be there.

i call datepicker as this (without theme)

<mp:DatePickerControl id="dp_end_date" runat="server" ShowTime="False" CssClass="forminput"></mp:DatePickerControl>

Any ideas?

Regards,

Victor

 

1/6/2012 10:24:10 AM
Gravatar
Total Posts 18439

Re: DatePicker - how to get it working ?

Hi Victor,

I would view the source of the page and see if the javascript exists that is wiring up the datepicker and that the jquery and jqueryui scripts are being loaded. I would look for script errors in firebug or check for files that are failing to load using the network tab in firebug. I would also check what versions of jquery and jqueryui you are using.

Hope that helps,

Joe

1/6/2012 10:40:52 AM
Gravatar
Total Posts 87

Re: DatePicker - how to get it working ?

Thnak you Joe,

One essential difference i see is that 

<button type="button" class="ui-datepicker-trigger">...</button>

is rendered in HTML markup on development machine, but not rendered on production version - is there some setting to check for this rendering?

Also not sure if it is related but in Chrome javascript console i see some errors (but not on development machine)

Uncaught TypeError: Object [object Object] has no method 'accordion'
event.aspx:80Uncaught TypeError: Object [object Object] has no method 'supersubs'
event.aspx:903Uncaught TypeError: Object [object Object] has no method 'cluetip'

JQuery and JQueryui are declared (as on all pages of mojoportal)

Regards,

Victor 

1/6/2012 11:02:09 AM
Gravatar
Total Posts 87

Re: DatePicker - how to get it working ?

Thank you again Joe,

just to confirm you were right Cool - the problem was in one extra load of old version Jquery later in the code that caused problems.

 

Regards,

Victor

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