The expand/collapse feature of the gantt control is purely a client feature, that doesn't trigger any postback or callback. This is why the pageLoad function is not called.
If you want to bind to an event after the html of the gantt is refreshed, you can use the following:
gantt = $find(
// Any code in here will be called when the gantt is refreshed