Finding if a tree item is already present

Hi,

I want to search for a tree item to see if it is present. I cannot use findItem() because it locates even if a substring matches the tree item. I want to alert the user if the new item that is to be inserted into a tree is a duplicate. Please help.

Thanks,
Dhanan.

You will have to add custom function of searching into your code.
Something about that:

function scan () { var i=0; var er=0; var content=new Array(); content=tree.getAllSubItems(0); content=content.split(","); for (i=0;i<=content.length-1;i++) { if (tree.getItemText(content[i])==document.getElementById('some_text').value) { alert ("such item is already exists"); er=1; break} }; if (er==0) // Here we have a needed action in the case of the title typed by user doesn't exists };