Get id fathers

How can I get only the id of the father’s in my tree?

If i understand you right, you need method getAllItemsWithKids()
docs.dhtmlx.com/api__dhtmlxtree_ … hkids.html