jqGrid tree nodes are read from server using json data. Click in node reads child nodes from server. Code below is used to restore opened tree node if page is loaded. Only s
On your place I would solve the problem in another way.
I would send to the server in postData
an additional parameter which contains the list of nodes which should be expanded.
In the case the server will place all requested nodes in the response. The value of "expanded" hidden column can be set to true
either directly in the server response or on the client side in the beforeProcessing
callback in the way which I described in the answer which you referenced.
In the way you would have exactly the same results which you need. The filling of the grid will be more quickly because of elimination of unneeded round-trips. The flashing will be removed because all the rows in the tree grid will be filled "at once" because of the usage of gridview: true
which is default for Tree Grids in the current implementation of jqGrid.