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

[Solved] Can't store Meta Data with MVC Treeview Model Binding

1 Answer 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark Rabjohn
Top achievements
Rank 1
Mark Rabjohn asked on 08 May 2010, 10:37 PM
Hi,

I don't know if I'm missing something obvious, but I've used the MVC Treeview Model binding stuff to iterate my object hierarchy which worked great for the visual rendering of the tree.

I then wrote a handler for the OnSelect client side event, and found that the getItemValue method doesn't work! I used the value to store my database key for the object, but it wasn't written to the html output.

Looking at the code for TreeView, it looks as though the Value property is only written to the output if using either Ajax or Web Service binding, or when the Checkbox is visible. I'm sure there must be a reason for this, but I can't see it at present.

Clearly "Value" can't be used to hold metadata, so is there an alternative method of storing Meta Data with my TreeViewItem?


My workaround for this was to make the checkbox be rendered by setting ShowCheckBox(true), and then using "$('.t-item .t-checkbox', this).hide();" in the TreeView OnLoad event - that way I can use the getItemValue method!

Is this a fault, or am I doing this wrong?

Mark

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 10 May 2010, 08:15 AM
Hello Mark Rabjohn,

This was a bug in the 2010.1.309 version. You can try the build attached in this support thread.

Best wishes,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Mark Rabjohn
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or