jQuery tree grid nodes can be loaded lazily from remote data store.

beforeTreeExpand event is used to request children nodes of the expanded node, and children are appended to expanded node upon arrival from server.

In server side code, we add pq_close property with value 1 or null to every row in response data to distinguish parent and children nodes respectively.

pq_close
1Node is closed
0Node is open
null or undefinedNode doesn't have any children

Following is the structure of the table in the database. (Only important fields are shown)

employeeID reportsTo FirstName LastName
12NancyDavolio
2AndrewFuller
32JanetLeverling
42MargaretPeacock
52StevenBuchanan
65MichaelSuyama
75RobertKing
82LauraCallahan
95AnneDodsworth