I have been using a 2012 Q2 release for a good while and have been using the Org Chart. With the Q3 update, I noticed it was now possible to get the node or item ID from client side javascript code (the Edit Employees demo). I've updated my Telerik version to the latest stable Q3 (2012.3.1016) and am getting javascript errors on page load. The error is as follows:
Uncaught TypeError: Cannot read property 'groupItems' of undefined ScriptResource.axd:774
I have copied the client side code exactly from the demo for showing/hiding the context menu. The following lines fail with an error (most likely due to the initial error):
var item = org._extractGroupItemFromDomElement(target);
var node = org._extractNodeFromDomElement(target);
The error for these two lines is:
Uncaught TypeError: Cannot read property 'nodes' of undefined ScriptResource.axd:788
Here is my definition of the Org Chart in the ASPX file:
Additionally, I should mention I am using the .NET 3.5 assemblies as this org chart is being hosted on a SharePoint 2010 Application Page. I am also using an AjaxManager to ajaxify the org chart based on various controls on the page. However, the same issue happens without the org chart being ajax enabled.
************EDIT: This is easily reproduced by having grouping enabled with two or more groups that do not have a parent set (so two groups that are not linked hierarchically, they are at the same level with no children or parents). Because of the initial error, dragging and dropping is broken and cannot be used to establish a hierarchical definition and thereby fixing the issue.
Uncaught TypeError: Cannot read property 'groupItems' of undefined ScriptResource.axd:774
I have copied the client side code exactly from the demo for showing/hiding the context menu. The following lines fail with an error (most likely due to the initial error):
var item = org._extractGroupItemFromDomElement(target);
var node = org._extractNodeFromDomElement(target);
The error for these two lines is:
Uncaught TypeError: Cannot read property 'nodes' of undefined ScriptResource.axd:788
Here is my definition of the Org Chart in the ASPX file:
<
telerik:RadOrgChart
ID
=
"RadOrgChart1"
runat
=
"server"
EnableDragAndDrop
=
"True"
OnGroupItemDrop
=
"RadOrgChart1OnGroupItemDrop"
OnNodeDrop
=
"RadOrgChart1OnNodeDrop"
DisableDefaultImage
=
"True"
GroupColumnCount
=
"2"
>
<
GroupEnabledBinding
>
<
NodeBindingSettings
DataFieldID
=
"TeamID"
DataFieldParentID
=
"ReportsTo"
DataSourceID
=
"TeamDataSource"
/>
<
GroupItemBindingSettings
DataFieldID
=
"StaffID"
DataFieldNodeID
=
"TeamID"
DataTextField
=
"Name"
DataSourceID
=
"StaffDataSource"
/>
</
GroupEnabledBinding
>
<
RenderedFields
>
<
NodeFields
>
<
telerik:OrgChartRenderedField
DataField
=
"TeamName"
/>
</
NodeFields
>
</
RenderedFields
>
<
ItemTemplate
>
<
span
><%#DataBinder.Eval(Container.DataItem, "Name")%></
span
>
<
br
/>
<
span
><%#DataBinder.Eval(Container.DataItem, "IsSupervisor").ToString() == "True" ? "Supervisor" : ""%></
span
>
</
ItemTemplate
>
</
telerik:RadOrgChart
>
Additionally, I should mention I am using the .NET 3.5 assemblies as this org chart is being hosted on a SharePoint 2010 Application Page. I am also using an AjaxManager to ajaxify the org chart based on various controls on the page. However, the same issue happens without the org chart being ajax enabled.
************EDIT: This is easily reproduced by having grouping enabled with two or more groups that do not have a parent set (so two groups that are not linked hierarchically, they are at the same level with no children or parents). Because of the initial error, dragging and dropping is broken and cannot be used to establish a hierarchical definition and thereby fixing the issue.