I am creating an rTree from an array. This array includes some custom properties. When I look at the nodeData after creating the rTree, I do in fact see the custom properties, however I am not able to retrieve them using the custom syntax:
put the accountID_of_node_ID_[email_id] of control "inbox"
Interestingly enough when I use this syntax to set the variable I am able to retrieve it:
set the accountID_of_node_ID_[email_id] of control "inbox" to 99
put the accountID_of_node_ID_[email_id] of control "inbox"
Can you explain how these user created properties work or point me to an area within the rTree code? I am unable to find the code that would be relevant. There is a lot of code here . Why would I not be able to retrieve a custom property that was created in an array?
Regards,
Mike
Setting and Retrieving Custom Properties within rTree
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Setting and Retrieving Custom Properties within rTree
Hi Mike!
What you are doing when you set a custom property with your:
is that you actually creates a customPropertySet with the name:
"accountID_of_node_ID_"
You should see it in your Property Inspector.
You can of course then get the value of your custom property with:
But note that this custom property will not get into the Tree array!
If you on the other hand put your custom property data into the Tree array in the first place
there are two ways you can retrieve that data:
Either get the array from the Tree into a variable and work with that:
or use a getProp handler in your control script to work with the customPropertySet syntax:
Hope this explains it!
Best regards
Mats
What you are doing when you set a custom property with your:
Code: Select all
the accountID_of_node_ID_[email_id] of control "inbox" to 99
"accountID_of_node_ID_"
You should see it in your Property Inspector.
You can of course then get the value of your custom property with:
Code: Select all
put the accountID_of_node_ID_[email_id] of control "inbox"
If you on the other hand put your custom property data into the Tree array in the first place
there are two ways you can retrieve that data:
Either get the array from the Tree into a variable and work with that:
Code: Select all
put the nodeData of control "inbox" into tNodeDataA
return tNodeDataA[email_id][accountID]
Code: Select all
getProp accountID_of_node_ID_[tID]
put the nodeData of control "inbox" into tNodeDataA
return tNodeDataA[tID]["accountID"]
end accountID_of_node_ID_
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