Welcome Guest Search | Active Topics | Sign In | Register

Calendar -- Disable selection / Disable month navigation Options
Jim
Posted: Sunday, November 13, 2011 12:43:02 PM
Rank: Newbie
Groups: Member

Joined: 11/13/2011
Posts: 3
I'm evaluating the EO.Web Calendar in multi-select mode and have a couple of questions...

Is there a way to put the Calendar in a "read-only" mode, where the user can see selected days but can't make any changes. The Enabled property doesn't seem to affect this?

Is there a way to disable the month navigation buttons in the header, or to hide the header completely?

Thanks
eo_support
Posted: Sunday, November 13, 2011 1:13:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

To disable date selection, handle the Calendar's DayRender event and put something like this in your event handler:

Code: C#
e.Writer.Write(
    @"<div 
        onmousedown='eo_CancelBubble(event);' 
        onclick='eo_CancelBubble(event);'>{0}</div>", 
    e.Day.DayNumberText);


To remove the header, give it a blank TitleTemplate:

Code: HTML/ASPX
<eo:Calendar ....>
    ....
    <TitleTemplate></TitleTemplate>
</eo:Calendar>


Hope this helps. Let us know if you still have any questions.

Thanks
Jim
Posted: Sunday, November 13, 2011 2:27:59 PM
Rank: Newbie
Groups: Member

Joined: 11/13/2011
Posts: 3
The Day_Rendering change didn't seem to have any effect. Here is the server-side event handler...

Code: C#
protected void cal_DayRender(object sender, EO.Web.DayRenderEventArgs e)
        {
                 e.Writer.Write(@"&lt;div onmousedown='eo_CancelBubble(event);' onclick='eo_CancelBubble(event);'&gt;"+e.Day.DayNumberText+"&lt;/div&gt;");
        }


The selection functionality is still active.

I used Firebug to make sure the cells were rendered as expected...

Code: HTML/ASPX
<td align="center" valign="top" style="height: 16px;">
<div class="eo_css_ctrl_ctl00_PageContent_ASPxGridView1_cell0_1_msDuty_cal8" style="width: 19px; height: 100%;">
<div onclick="eo_CancelBubble(event);" onmousedown="eo_CancelBubble(event);">1</div>
</div>
</td>


Did I miss something?

Thanks
Jim
eo_support
Posted: Sunday, November 13, 2011 2:49:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Try to add this to the DIV:

onmouseup='eo_CancelBubble(event);'

You may also want to explicitly set the DIV's height and width. The selection event is handled on the outer table level. So if the DIV does not fill the entire table cell, clicking a table cell in area that is not occupied by the DIV will still trigger the selection. If the Calendar has a hover style, make sure the hover style does not have border/paddings. Otherwise clicking on the border/margin area will trigger the selection as well.

Please let us know if this works for you.

Thanks!
Jim
Posted: Sunday, November 13, 2011 4:12:54 PM
Rank: Newbie
Groups: Member

Joined: 11/13/2011
Posts: 3
Adding the onmouseup handler did the trick! Thanks for the fast response... and on a weekend too!!
eo_support
Posted: Sunday, November 13, 2011 4:18:36 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are very welcome. Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.