Handling the Response
The TreeManager object is the access point to the component. This object bridges the gap between the Ajax response and the Tree object in the view or the GUI.
TreeManager may be a small object, but it helps to separate the back-end response data from the GUI by adding an extra layer to act as a data controller, which is something we will cover in more detail in Chapter 15, “Model View Controller.”
The display method (see Listing 11.3) first checks to see if the ready state of the Ajax object is successful. After it receives the 'OK' string, it is ready to parse the response from the request. The difference between this controller and the controllers in the other components is that we do not actually parse any data from the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access