TreeGrid and onRowSelect

Using a TreeGrid, is there any way to tell in the onRowSelect event if the user is selecting the branch or the leaf? In my case I have folders and files. I want to run some extra code if a file (leaf) is selected, but not if the folder (branch) is selected.


You may try to use getLevel() method to now the level of needed row:

Also you may try to use getAllSubItems() method to check if the row has nested rows: