We use HTML elements as the text for each item to hold the URL to each item on our web site. For example:
<item text=“Page 1 title”
…
What we are seeing with findItem() is that it searches all text in the text attribute of the element, including the URL. So, for example, if we have a page with a title “HTML”, and we use findItem() to find this page in the tree, every item in our tree will match, because every page has HTML in the URL (for example: …/test1.HTML).
Is there any way to have findItem() only search the text and not the URL of the tree items?
Is there any way to have findItem() only search the text and not the URL of the tree items?
It will requrie complex modification to source code.
The find item functionality converts entered text into regexp, which will be used in search
dhtmlxtree.js line 3971
searchStr = new RegExp(searchStr.replace(/([?*+\[]()]{1})/gi,"\$1").replace(/ /gi,".*"),“gi”);
you can modify this code to your requirements
The more simple solution is to use just text part of link inside text attribute and use onClick event of tree to change page location instead of inline links