11 Answers, 1 is accepted
You can check the following help articles:
http://www.telerik.com/help/aspnet-ajax/tree_clientprogramming.html
http://www.telerik.com/help/aspnet-ajax/tree_clientradtreeviewobject.html
Regards,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
But still I am having some problem with it.
I tried with set_enabled(false/true) or get_enabled(). But it is always showing as Object doesn't support this property or method Error.
I am giving the complete ClientID from the debugger here ctl00_cphMainContent_rTreeView.get_enabled().
Please let me know if I am doing something wrong or what else can I do.
You are not accessing correctly the treeview client-side object. Please check the first help article for more details.
All the best,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Hi Albert,
From the link provided - "http://www.telerik.com/help/aspnet-ajax/tree_clientradtreeviewobject.html'
I tried implementing the below function in my application;
function disableTreeView()
{
var tree = $find("<%= RadTreeView1.ClientID %>");
if(tree.get_enabled())
{
tree.set_enabled(false);
}
else
{
tree.set_enabled(true);
}
}
Query 1: I'm unable to execute code with "$find", Is it a javascript built-in function?
Query 2: Instead of "$find", I tried the following:
var ctrl='<%=rTreeView.ClientID%>';
var tree = document.getElementById(ctrl);
tree.set_enabled(true);
But the above code threw an error saying "Object does not support set_enabled method". I'm using RadTreeView.Net2.dll - version: 6.0.3.0.
Please let me know whether its supported in this version.
Regards,
Avik Basu
$find is built-in function in ASP.NET Ajax. Which version of RadTreeView are you using? It seems you are not using RadTreeView for ASP.NET Ajax albeit you have specified so.
Regards,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Even if I'm not using the latest version of radtreeview, I'm able to enable the text of the nodes of the radtree, but not being able to enable the checkboxes related to the nodes.
In the server side I'm using the code to disable as
rTreeView.Enabled=false;
In the client side I'm looping through the whole radtree and making each node enable as
tree.AllNodes[i].Enabled=true
What is the wrong with this approach, that it is not enabling completely (only on clicking on the text the checkbox is getting checked but the checkbox itself is disabled)?
What is the alternative solution to enable both the checkboxes and the nodes with the current version I'm using?
You should use the Enable()/Disable() client-side methods of the RadTreeNode object. Setting the Enable field will not disable the checkbox.
Regards,
Albert
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The radtreeview is working fine now. But I am again facing a small problem in enabling a radDatePicker control.
The current scenario is like I have enabled the textbox of the radDatePicker but on clicking of the calendar popup button the calendar is not shown.
I have used the following piece of code.
document.getElementById(obj17).parentElement.disabled=
false;
objrDatePicker.DateInput.Enable();
Please help me tp enable the calendar control.
Regards,
Avik
1. I got the user controls so when I am using the code like:
obj16.PopupButton.onclick =
function()
{
obj16.TogglePopup();
return false;
}
it is always coming beside one control, I am not getting two calendars for eah of the two radDatePicker.
2. On clicking on any date, the selected date is not appearing in the textbox of the datepicker.
How will I able to get the control enabled from the client side.
Plese let me know ASAP because it's very urgent for me
Regards,
Avik
You can enable and disable RadDatePicker totally on the client in the following way. We have two RadDatePickers and a button which toggeles the enabled/disabled state:
<table> |
<tr> |
<td> |
<telerik:RadDatePicker ID="Picker1" runat="server"> |
</telerik:RadDatePicker> |
</td> |
<td> |
<telerik:RadDatePicker ID="Picker2" runat="server"> |
</telerik:RadDatePicker> |
</td> |
<td> |
<asp:LinkButton ID="Button1" runat="server" Text="Disable" OnClientClick="return Click(this, event);"></asp:LinkButton> |
</td> |
</tr> |
</table> |
And we define the javascript Click() event handler in the following way:
function Click(sender, args) |
{ |
var picker1 = $find("<%= Picker1.ClientID %>"); |
var picker2 = $find("<%= Picker2.ClientID %>"); |
picker1.set_enabled(!picker1.get_enabled()); |
picker2.set_enabled(!picker2.get_enabled()); |
if(picker1.get_enabled()) |
sender.innerHTML = "Disable"; |
else |
sender.innerHTML = "Enable"; |
return false; |
} |
This code toggles between the enabled/disabled states of the two RadDatePickers. When RadDatePicker is disabled, it is grayed out and inaccessible both for the input and for the calendar button.
Kind regards,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center