This question is locked. New answers and comments are not allowed.
I'm currently using jQuery 1.6.4 and I have a tree view listing the provinces and territories in Canada and the states in the USA, with the two countries being the two top nodes and the provinces & states being child nodes. But I noticed when testing it that I can't deselect any of the check boxes once they've been checked (parent or child). If I remove my reference to jQuery 1.6.4 and let the call to the Telerik Script Registrar import 1.5.1 it seems to work fine. I've removed the layout from my view and eliminated all of my other script files to ensure I wasn't getting an unintended cross over behaviour it still has the same problem. I have been testing in Chrome but the same problem is present in IE9 and Firefox. Am I missing something or is this a bug?
@model IList<
Country
>
@{
Layout = "";
IList<
State
> states = (IList<
State
>)ViewData["selectedStates"];
}
<
script
src
=
"@Url.Content("
~/Scripts/jquery-1.6.4.min.js")"
type
=
"text/javascript"
></
script
>
@(Html.Telerik().StyleSheetRegistrar()
.DefaultGroup(group => group.Add("telerik.common.css")
.Add("telerik.default.css")))
@(Html.Telerik().TreeView()
.Name("RegionStates")
.ShowCheckBox(true)
.ExpandAll(true)
.BindTo(Model.OrderBy(x=>x.Name), mappings =>
{
mappings.For<
Country
>(binding =>
binding.ItemDataBound((node, country) =>
{
node.Text = country.Name;
node.Value = country.CountryId.ToString();
node.Checked = country.States.All(x => states.Any(y => y.StateId == x.StateId));
})
.Children(country => country.States.OrderBy(x => x.Name).ToList()));
mappings.For<
State
>(binding => binding.ItemDataBound((node, state) =>
{
node.Text = state.Name;
node.Value = state.StateId.ToString();
node.Checked = states.Any(x => x.StateId == state.StateId);
}));
})
)
@Html.Telerik().ScriptRegistrar().jQuery(false)