0 Replies Latest reply on Jan 12, 2018 12:40 AM by thatsmealright

    Cursor coordinates in a treeview with a scrollbar


      Greetings good Sir,


      I am trying to select an item just by hovering over one in a treeview. In order to do so, I create an addEventListener associated to the treeview and recover the cursor position using the clientX / clientY values.

      Please find below an example but with a click event instead (to simplify the code):


           Palette.Treeview.size = [200, 100];

           myOnClick = function(p)




          Palette.Treeview.addEventListener('click', myOnClick); 


      The problem: clientY gives the position of the cursor relative to the position of the treeview within the window and so, does not take into account the scrolling.


      Adobe's Javascript Tool Guide and "Script UI for dummies" make it seems like the scrollbar is inaccessible inside a treeview. True enough, I was unable to add a scrollbar to a treeview.


      So here come my questions:

      Can the cursor position within the "virtual" treeview space be obtained?

      Otherwise, is there a way to obtain the scrolling value of scrollbars naturally occurring in treeviews?