а

tree.findItem currency symbol


#1

Hi,

Not able to find and position the cursor in a Tree using findItem if the search text contains a currency symbol ‘$’. Viz

<item text="Analysis [$2,000]" id="Backlog-3263"/>

tree.findItem(searchStr, direction, top);
If searchStr = Analysis [$2,000] then not found
If searchStr = $2,000 then not found
If searchStr = Analysis [ 2,000] then found

This was discovered when trying to find and position the cursor by convolution due to absence (or not knowing) of a findItemById method when entering number 3263

function treeFindItem(a, b){ var strsearch = document.getElementById('stext').value; if ($.isNumeric(strsearch)){ // convert number to tree node strsearch = mnutree.getItemText('Backlog-'+strsearch); } mnutree.findItem(strsearch,a,b); }

Raymond


#2

I can confirm the issue. We will include the fix in the next update, if you need the fix ASAP, please contact support@dhtmlx.com


#3

Thanks Stanislav,

This is not urgent as I’ve implemented a workaround, viz:

function treeFindItem(a, b){ var strsearch = document.getElementById('stext').value; if ($.isNumeric(strsearch)){ // convert number to tree node var id = mnutree.getItemText('Backlog-'+strsearch); // then convert '$' to ' ' (space) strsearch = id.replace("$", " "); } mnutree.findItem(strsearch,a,b); }

Is there not a corresponding find/locate/position tree method using ‘id’ rather than text?

Raymond