Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by RamaRao R on Nov 24, 2009 22:40
open dhtmlx forum
Find functionality 'Begin With' and 'Ends With' in Tree

 DhtmlX tree is supporting 'Contains With' find functionality with the below code:

<input type="text" id="stext" width="200px" onKeyPress="returnKey()">
 <a href="javascript:void(0)" onClick="tree.findItem(document.getElementById('stext').value,0,1)"> Find </a> |
 <a href="javascript:void(0)" onClick="tree.findItem(document.getElementById('stext').value)"> Find Next</a> |
 <a href="javascript:void(0)" onClick="tree.findItem(document.getElementById('stext').value,1)"> Find Prev </a>

Now, I want to have find functionality 'Begin With' and 'Ends With'.

Please suggest me a waynto achive this.

Thanks,

RamaRao R.

Answer posted by Alex (support) on Nov 25, 2009 01:57

Tree doesn't provide 'Begin With' and 'Ends With' functionalities for search. 

So, you should create own method to achieve this. There are following methods that can be used in this case:

 - getAllSubItems: it returns list of ids in a ceratin branch, for example var list = tree.getAllSubItems(0); returns ids list of all items in tree ( or getSubItems to organize loop through all levels)

 - getItemText - returns item label