This is a migrated thread and some comments may be shown as answers.

Error thrown after fancybox called.

1 Answer 137 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 24 Apr 2013, 01:40 PM
I have a fancybox (lightbox style plugin) which calls a div containing a treeview mvc wrapper.
This error is thrown when the lightbox is called (referring to line 24 from the kendo minified scripts file)

Line: 24
Error: Unable to get value of the property 'uid': object is null or undefined


The treeview;
@(Html.Kendo().TreeView()
    .Name("treeview")
    .DataTextField("TableName")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("ExportAll", "Export")
        )
    )

The treeview loads fine on the page into a div (originally hidden by parent div - before fancybox is loaded) and I can view it if i remove the "display:none" on the parent div.

It is at the point that the fancybox is loaded that the error is thrown.

This lead me to think that there was an issue with the fancybox, but if I replace the treeview with any other kendo wrapper - chart, grid etc then the lightbox works fine.

Is there an issue with fancybox and treeview combined?

Thanks


1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 26 Apr 2013, 12:19 PM
Hello Alan,

I am not familiar with the exact way FancyBox works, but in case it moves elements in the DOM, the initilization script of the TreeView will be executed twice, which may lead to undesired effects.

Your options include:

+ use a client-side-only Kendo UI TreeView and initialize it after its container has been opened on top of the other content on the page
+ use a client-side-only TreeView and have its initialization script somewhere outside the FancyBox div container
+ remove the TreeView initialization <script> tag from the DOM after the TreeView has been initialized and before the FancyBox is initialized

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Alan
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or