Just run on a situation when “treetable.clearAll();” generates an error “Data loading error, check console for details” if the treetable is empty (initial page load).
The temporary fix is to add check for empty data:
if (treetable.count() != 0) treetable.clearAll();