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.

Thanks!

You may try to use getLevel() method to now the level of needed row:
http://docs.dhtmlx.com/doku.php?id=dhtmlxtreegrid:api_method_dhtmlxgridobject_getlevel

Also you may try to use getAllSubItems() method to check if the row has nested rows:
http://docs.dhtmlx.com/doku.php?id=dhtmlxtreegrid:api_method_dhtmlxgridobject_getallsubitems