Hi Mats,
I am using an rTree for outline navigation (think of 'folders') and a data grid (think of folder contents, which can include folders).
When the user selects a rTree node, the dgData of the data grid will be set to a data set. This can be triggered through the hilitedNodeIDs of the rTree (as long as this list has only one entry, as raised in http://forums.runrev.com/phpBB2/viewtop ... =51&t=7857
However, when a user selects a row in the data grid, I need to set the hilite of the corresponding rTree node (and expand the node's parents to make it visible) but the following syntax doesn't seem to set the node hilite...
set the hilited_of_node_ID_[2] of control "Tree" to true
What is the correct syntax to achieve this - or is this a feature request?
Best,
Keith..
Set the hilited of node...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Set the hilited of node...
Hi Keith!
Thank you for the description of what you are doing! It is always nice to have examples of how rTree is used and the combination with the Data Grid is a good one!
To hilite one or more nodes you use the hilitedNodeIDs property of the rTree control. The hilited property of a node is read only. This is consistent with the hilitedLines property of a field control in LC (you can not set the hilited of a line). So to accomplish what you need you could do something like this:
All the best
Mats
Thank you for the description of what you are doing! It is always nice to have examples of how rTree is used and the combination with the Data Grid is a good one!
To hilite one or more nodes you use the hilitedNodeIDs property of the rTree control. The hilited property of a node is read only. This is consistent with the hilitedLines property of a field control in LC (you can not set the hilited of a line). So to accomplish what you need you could do something like this:
Code: Select all
on mouseUp
set the itemDelimiter to slash
repeat for each item tPathID in the IDpath_of_node_ID_[theNodeID] of me
set the expanded_of_node_ID_[tPathID] of me to true
end repeat
set the itemDelimiter to comma
set the hilitedNodeIDs of me to theNodeID
dispatch "renderTree" to me
end mouseUp
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Re: Set the hilited of node...
Hi Mats,
Glad you like this use case for rTree. This is a commercial product development and I intend to show my app in a future livecode.tv LiveCode live coding event (but there's a lot to do before then!).
Thanks for the code snippet for expanding the path to a specific node. That has saved me some head-scratching.
Thanks also for the clarification on the hilited property. The intent behind this requirement to 'set' the node hilite is really only cosmetic - to show the user that the focus of the combined rTree/datagrid navigation system has changed. Is it possible to set the fill colour of the node so that it appears to be highlighted (the user would know no different)?
Best,
Keith..
Glad you like this use case for rTree. This is a commercial product development and I intend to show my app in a future livecode.tv LiveCode live coding event (but there's a lot to do before then!).
Thanks for the code snippet for expanding the path to a specific node. That has saved me some head-scratching.
Thanks also for the clarification on the hilited property. The intent behind this requirement to 'set' the node hilite is really only cosmetic - to show the user that the focus of the combined rTree/datagrid navigation system has changed. Is it possible to set the fill colour of the node so that it appears to be highlighted (the user would know no different)?
Best,
Keith..
Re: Set the hilited of node...
Hi Keith
About setting the fill colour of the node so that it appears to be highlighted:
This is a planned feature for rTree 2.0.
Best regards
Mats
About setting the fill colour of the node so that it appears to be highlighted:
This is a planned feature for rTree 2.0.
Best regards
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Re: Set the hilited of node...
Hi Mats,
Thanks for the heads-up.
FYI, I was able to spoof the appearance of a hilite by using 'set the hilited line' of the container field.
Best,
Keith..
Thanks for the heads-up.
FYI, I was able to spoof the appearance of a hilite by using 'set the hilited line' of the container field.
Best,
Keith..