Reading child item values from a TreeList
- 5 years ago
It's a bit of an odd task, I was hoping there was some way to be able to write a piece of reusable code that I could use with most treeLists I encounter in my program. This is was I came up with so far, but my programming knowledge is limited so I may also be missing something.
function GetIndexOfDataTable(name)
{
var treeListEx = Aliases["Spry"]["Main"]["LeftPanel"]["ProjectExplorer"]["tree"];
var dataRoot = treeListEx["wChildView"](0);
var data = dataRoot["wChildView"](0);
var rowCount = data["wRowCount"];
var indexer = 0;
while(indexer < rowCount)
{
var testTable = treeListEx["wChildView"](indexer);
data["ClickCell"](indexer,"Column");
if(treeListEx["FocusedValue"] == name)
{
data["DblClickCell"](indexer,"Column");
return indexer;
}
indexer = indexer + 1;
}
return null;
}