Hi!
I am trying to set a checkbox value to true/false based on a cookie on the client side. This works perfectly well outside the toolbar, but not when the checkboxes are inside. Nothing happens. Have anyone experienced this before? Here is the code:
I am trying to set a checkbox value to true/false based on a cookie on the client side. This works perfectly well outside the toolbar, but not when the checkboxes are inside. Nothing happens. Have anyone experienced this before? Here is the code:
| function loadToolBar() { |
| var toolBar = $find("<%=reportToolBar.ClientID %>"); |
| var tdTool = toolBar._findItemByText("timeVsDepth"); |
| var chkBoxTimeDepth = $telerik.findElement(tdTool.get_element(), ("chkBoxOptionsTvsD")); |
| var wsTool = toolBar._findItemByText("wellSchematic"); |
| var chkBoxWellSchematic = $telerik.findElement(wsTool.get_element(), ("chkBoxOptionsWS")); |
| var gantTool = toolBar._findItemByText("gant"); |
| var chkBoxGant = $telerik.findElement(gantTool.get_element(), ("chkBoxOptionsGant")); |
| var gantChecked = (getCookie("currentGant")); |
| var timeDChcked = getCookie("currentTimeDepth"); |
| var wellSChck = getCookie("currentWellSch"); |
| if (gantChecked != null && gantChecked == "true") { |
| chkBoxGant.checked = true; |
| document.getElementById("chkboxTest").checked = true; |
| gantTool.check(); |
| } |
| if (timeDChcked != null && timeDChcked == "true") { |
| chkBoxTimeDepth.checked = true; |
| tdTool.check(); |
| } |
| if (wellSChck != null && wellSChck == "true") { |
| chkBoxWellSchematic.checked = true; |
| wsTool.check(); |
| } |
| } |
| <telerik:RadToolBar ID="reportToolBar" Runat="server" Width="100%" OnClientButtonClicked="selectViewOptions" Skin="DBR" EnableEmbeddedSkins="false" OnClientLoad="loadToolBar" > |
| <Items> |
| <telerik:RadToolBarDropDown runat="server" Text="Report Options" Width="50"> |
| <Buttons> |
| <telerik:RadToolBarButton runat="server" Text="timeVsDepth" Value="timeDepth"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsTvsD" runat="server" Text="Include time vs depth" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Text="wellSchematic" Value="wellSchematic"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsWS" runat="server" Text="Include well schematic" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Text="gant" Value="gant"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsGant" runat="server" Text="Include 1 week plan" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| </Buttons> |
| </telerik:RadToolBarDropDown> |
| </Items> |
| </telerik:RadToolBar> |