findItemIdByLabel - exact match?

Hi,

it seems the findItemIdByLabel is using some substring compare method?
I’m searching for the label “Auskunft Stücklisten” which isn’t used in the tree.
So my thought is that findItemIdByLabel should return null.

But instead of null it finds the node with the label “Auskunft Stücklisten (erweitert)” which isn’t a real match.

What I’m trying to do is to allow to only drag an item once - so i have to do an EXACT matching.
How can i achieve this and what am i doing wrong?

But instead of null it finds the node with the label “Auskunft Stücklisten (erweitert)” which isn’t a real match.

This is correct behaviour.

You may modify the private tree method - _findNodeByLabel:

locate the following line:
dhtmlXTreeObject.prototype._findNodeByLabel=function(searchStr,direction,fromNode){

and replace the following lines:

var searchStr=searchStr.replace(new RegExp("^( )+"),"").replace(new RegExp("( )+$"),"");
searchStr = new RegExp(searchStr.replace(/([?*+\[]()]{1})/gi,"\$1").replace(/ /gi,"."),“gi”);/

with:
var searchStr = new RegExp("^"+searchStr+"$");