iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
What should the Intersoft's TreeView GetNodes method return? It's not listed within the 2009 R1 documentation but it exists within the online example. I get the root node twice which appears to be a bug. I'd assume all nodes would be return. Even if it returns the first node in the heirarchy, it should not be listed twice.
You could check the Nodes.IsPopulate property to ensure whether the TreeView has completed the loading process. If it has not set the timeout to wait for the TreeView to complete its process. Here is the snippet:
function WebTreeView1_OnInitialize(ctrlId) { AlertNodesAfterComplete(); } function AlertNodesAfterComplete() { var treeview = ISGetObject("WebTreeView1"); if (treeview.Nodes.IsPopulate) { WebTreeView_GetNodes(); WebTreeView_GetArrayNodes(); } else { setTimeout(function() { AlertNodesAfterComplete(); }, 10); } }
Using the provided sample, Client_FundamentalAPI.aspx, in the WebTreeView sample. The GetArrayNodes return the correct information of the node in the tree view. Did this issue also occurs in the provided sample?
I've modified the Client_FundamentalAPI.aspx file with a very simple example that shows the bugs with the above mentioned methods.
It seems you will need to use timeout function to wait for the WebTreeView to finish the initializing process to retrieve the correct value. In the attached modified sample, I use 500ms timeout to make sure the WebTreeView finish the initializing process before reporting the nodes length.
Is this the only option? It seems like there would be a chance where 500ms isn't enough and the logic would fail.
Is there some sort of property/event that can be handled to determine when the WebTreeView is done with its initialization and the correct data would be returned?
EDIT: Removed
I found another bug. Similar to the page I modified above to illustrate another bug but this TreeView does not load on demand. Using the TreeView's Nodes property, only the first level exist. For example:
ISGetObject("treePortfolioNav").Nodes .length (3 is returned; Correct value)
ISGetObject("treePortfolioNav").Nodes[0].Nodes.length (0 is returned; Incorrect value)
ISGetObject("treePortfolioNav").GetArrayNodes() (38 is returned;)
ISGetObject("treePortfolioNav").Nodes[0].Nodes.length (2 is now returned; Correct value)
Why would GetArrayNodes cause the rest of the collection to "load"?
In order to get the correct length, please use the
ISGetObject("treePortfolioNav").Nodes[0].Get("Nodes").length
The GetArrayNodes function will load all the collection to the JS object. You could manually build the collection using the Get("Nodes") function.
In order to get the correct length, please use theISGetObject("treePortfolioNav").Nodes[0].Get("Nodes").lengthThe GetArrayNodes function will load all the collection to the JS object. You could manually build the collection using the Get("Nodes") function.
The only reason why the GetArrayNodes is used is to ensure that the node.Nodes collection is properly populated. Is there a timeline when this will be fixed? It's much cleaner to be able to use the node.Nodes collection instead of calling various methods.
This behavior is designed in WebTreeView for performance concern. WebTreeView will not populate the Nodes object recusively during onload. It will populate the Nodes object during certain event such as expand. Or you could manually trigger it using Get("Nodes") or GetArrayNodes.
Thank you. As a workarond, I call the GetArrayNodes method to force the loading of the Nodes collection. This allows me to use the Nodes collection like other TreeView implementations. The documentation should be updated to reflect that this collection isn't loaded for performance reasons.
Thanks for the help!
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname