Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

InDesign CC: ScriptUI TreeView broken

$
0
0

Some troublesome news regarding the treeview in InDesign CC, ver. 9.0 (updated today through ).

 

Using the treeview in "InDesign Creative Cloud" trees can no longer be built dynamically, since there are no plus signs for expanding, until children are added (and then it's too late).

 

The onDoubleClick event also seems to be removed from the TreeView.

 

Regarding building the tree dynamically, by loadning new nodes when clicking "+":

In CS6 and before, the Node object always had a plus sign. If you clicked it, you could have an onExpand event hooked up, that added child nodes "on the run".

If the node was not to be expanded ever (no plus sign) you added an "item" instead of a "node".

 

In InDesign CC however, nodes without children are always shown without plus signs, making it impossible to load the children dynamically, since there is no way for the user to trigger an onExpand event. The nodes appear just as the items did in CS6. Here is a screen shot of a treeview, the same code running in CS6 (left) and InDesign Creative Cloud (right):

 

CS6-vs-CC-same-code-window.png

 

 

As you can see, the plus (or rather "turnable triangular things" in the dark and cool new super UI of CC) are missing in CC.

 

Here is the code (which also demonstrates that the onDoubleClick event no longer works, double click a node text in CS6, and the message "Doubleclick will appear", in CC no message appears when double clicking a node):

 

#targetengine 'testengine1'
var Window1 = new Window('palette','My window');
buildWindow();
Window1.show();

var nodeDoubleClickHandler = function(){
    alert('Doubleclick')
}
var nodeExpandHandler = function(item){        alert(item.text);
}

function buildWindow(){
       Window1.Treeview1 = Window1.add('treeview',undefined,undefined);    Window1.Treeview1.onExpand = nodeExpandHandler;    Window1.Treeview1.onExpand = nodeDoubleClickHandler;    Window1.Treeview1.Node1 = Window1.Treeview1.add('node',"Node 1 (node)");    Window1.Treeview1.Node2 = Window1.Treeview1.add('node',"Node 2 (node)");    Window1.Treeview1.Node3 = Window1.Treeview1.add('item',"Node 3 (item)");

}

Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>