|
|
|
|
Extensions
Last post Thu, Sep 11 2008, 9:57 AM by jasonkim. 14 replies.
-
-
Thu, May 22 2008, 12:07 AM |
-
ga
-
-
-
Joined on 07-25-2007
-
-
Posts 204
-
-
|
Hi, you can assign any object to Extensions property of calendar item. For instance you have a "div" with id="MyId" in item template and you want to set some font color inside it. You can put html color string to item extensions: item.Extenstions = "#ffffcc"; In this case your item mapping can look like this: ...{\"id\":\"MyId\",\"property\":\"style.color\", \"value\":\"Extentions\"}...
Or you assign object with public string field or property "Color" which will contain html color. In this case your item mapping can look like this: ...{\"id\":\"MyId\",\"property\":\"style.color\", \"value\":\"Extentions.Color\"}...
Hope this helps.
|
|
-
-
-
-
-
Wed, Sep 03 2008, 7:30 PM |
-
mahichr
-
-
-
Joined on 07-15-2008
-
-
Posts 22
-
-
|
I'm using VB.NET for my application. Here is the ItemTemplate for Day view
ItemTemplate = "<div id=""T1"" style=""height:1px; font-size:1px; line-height:1px; margin:0px 2px;""></div>" + _ "<div id=""T2"" style=""height:1px; font-size:1px; line-height:1px; margin:0px 1px;""></div>" + _ "<div id=""T3"" style=""height:100%;"">" + _ "<table id=""Header"" border=""0"" cellpadding=""2"" width=""100%"" cellspacing=""0"" style=""width:100%; font-weight:bold; font-size:11px; color:#ffffff; table-layout:fixed; overflow:hidden; font-family:Verdana,Sans-serif;"">" + _ "<tr mcc_action=""move"">" + _ "<td style=""cursor:move; overflow:hidden;"" unselectable=""on"">" + _ "<table><tr>" + _ "<td><span id=""sHour"" ></span>:<span id=""sMinute""></span></td>" + _ "<td><img border='0' width='9px' height='7px' src='../Images/g_repeat_white.gif' id=""isRecurring""/></td>" + _ "</tr>" + _ "</table>" + _ "</td>" + _ "</tr>" + _ "</table>" + _ "<div id=""title"" style=""cursor:default; color:#ffffff; font-family:Verdana,Sans-serif; font-size:11px;"" unselectable=""on""></div>" + _ "<div id=""resizer"" mcc_action=""resize"" style=""font-size:5px; line-height:5px; position:absolute; bottom: 5px; height:5px; width:100%; z-index:11; cursor:s-resize;"">" + _ "<table width=""100%"" height=""100%""><tr><td align=""center"" style=""color:#ffffff"">--------------</td></tr></table>" + _ "</div>" + _ "</div>" + _ "<div style=""position:absolute; bottom:0px; width:100%;"">" + _ "<div id=""Footer"" style=""height:1px; font-size:1px; line-height:1px;""></div>" + _ "</div>"
The ItemTemplateMapping is below
itemMapping = "[" + _ "{""id"":""T1"",""property"":""style.backgroundColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""T2"",""property"":""style.backgroundColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""T3"",""property"":""style.backgroundColor"",""value"":""Extensions.Color2""}," + _ "{""id"":""T3"",""property"":""style.borderLeftColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""T3"",""property"":""style.borderRightColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""Header"",""property"":""style.backgroundColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""title"",""property"":""innerHTML"",""value"":""Title""}," + _ "{""id"":""sHour"",""property"":""innerHTML"",""value"":""StartDate.getHours()<10?'0'+item.StartDate.getHours():item.StartDate.getHours()""}," + _ "{""id"":""sMinute"",""property"":""innerHTML"",""value"":""StartDate.getMinutes()<10?'0'+item.StartDate.getMinutes():item.StartDate.getMinutes()""}," + _ "{""id"":""isRecurring"",""property"":""style.display"",""value"":""Extensions.IsRecurring==true ? 'block':'none'""}," + _ "{""id"":""Footer"",""property"":""style.backgroundColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""Footer"",""property"":""style.borderLeftColor"",""value"":""Extensions.Color1""}," + _ "{""id"":""Footer"",""property"":""style.borderRightColor"",""value"":""Extensions.Color1""}" + _ "]" Everything works fine except the second and third property value mapping never gets applied to the DIV tag "T3". The first property get applied to DIV Tag "T3" without any problem. Same problem for the DIV Tag "Footer"
|
|
-
Thu, Sep 04 2008, 2:34 AM |
-
ga
-
-
-
Joined on 07-25-2007
-
-
Posts 204
-
-
|
Hi, just add to "style" attribute of divs "T3" and "Footer" properties "border-left" and "border-right" with values "solid 1px" in item template:
... "<div id=""T3"" style=""height:100%; border-left:solid 1px; border-right:solid 1px;"">" ... "<div id=""Footer"" style=""height:1px; font-size:1px; line-height:1px; border-left:solid 1px; border-right:solid 1px;""></div>" ...
Hope this helps.
|
|
-
Sat, Sep 06 2008, 3:47 PM |
-
-
-
Tue, Sep 09 2008, 12:53 AM |
-
ga
-
-
-
Joined on 07-25-2007
-
-
Posts 204
-
-
|
Hi, please download "clean" evaluation web-sample from http://www.mediachase.com/Profile/CustomerDownloads.aspx. Replace "Default.asmx.cs" and "GoogleCalendar.ascx.cs" files with the ones from the attacment. Rebuild web-sample and create not recurring item with some title in Week or Day view. You'll see colored left and right borders around div with title as in attached screenshot.
List of changes: An instance of "MyExtensions" class is assigned to "Extensions" property of calendar item. This class has public properties "IsRecurring" (bool), Color1 (string), and Color2 (string).
CalendarItem it = new CalendarItem(dr["Id"].ToString(), dr["Title"].ToString(), ((DateTime)dr["StartDate"]).ToString("yyyy.M.d.H.m.s"), ((DateTime)dr["EndDate"]).ToString("yyyy.M.d.H.m.s"), dr["Description"].ToString(), (bool)dr["IsAllDay"], new MyExtensions(false, "yellow", "red"));
In multiday item template "solid 1px" left and right borders were added to title div. In multiday item mapping the following lines were added for title div:
..."{\"id\":\"title\",\"property\":\"style.borderLeftColor\",\"value\":\"Extensions.Color1\"}," + "{\"id\":\"title\",\"property\":\"style.borderRightColor\",\"value\":\"Extensions.Color2\"}," +...
|
|
-
-
-
|
|
|
|