This question is locked. New answers and comments are not allowed.
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
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