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
I have a treeview having more than 2000 nodes, so when I search a node(that resides quite below in treeview or all the nodes expanded), using Find functionality, It become selected but didn't come up to treeview visible area. I mean, you have to manually scroll down up to found node.
Is there a way to bring the searched node up or can set the scroll bar position infront of searched node.
Waiting for your response.
Thanks!
Shailendra Singh
Hello Shailendra,
Here's a snippet code to fill your request. In this code, it's also possible to expand only the searched node if the WebTreeView is in collapsed mode.
function btn_Click() { var txt = document.getElementById("TextBox1").value; var treeview = ISGetObject("WebTreeView1"); var frameelement = treeview.GetFrameElement(); //use this to expand searched node's parents var node = treeview.FindNodesByText(txt)[0]; var parent = node.Parent; while (parent && parent.Expand) { parent.Expand(); parent = parent.Parent; } //this is for showing the searched node node.Select(); frameelement.children[0].scrollTop = ISPosLib.getTopW3C(node.GetElement()); }
Hope this helps.
Best Regards,Erwin Sanders
Hello,
That's odd, it works everytime on my end though. I'm using WebTreeView 2 and had it tested on Chrome and IE 11. Have you modified the function to suit your needs? Anyway, I'm sending you a webform showing you how I implement the function itself.
Had you find any trouble with my sample, please let me know.
Thanks for your reply. I just modified your sample with runtime binding of treeview and enabling selected node postback as per my my application requirement. Same solution doesnt work.
Thank you for the additional information about postback. I managed to modify the function to suit your needs. Using ISPosLib.getTopW3C, it's possible to get the node position value for the scrollTop property. I also substract it with the WebTreeView frame element itself in case you aren't placing the WebTreeView on top of the page.
I attached the modified sample for you.
Thank you for the information. That solution should be useful for future reference. Sorry if I couldn't help much on the issue.
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