This sample demonstrates how you can use client-side JavaScript to populate the WebDrillDown popup menus.
To support this feature, WebDrillDown uses the following client-side method:
function cwddOnBeginRequest(controlId, requestPath)
This is a callback method that needs to be implemented by you.
WebDrillDown will automatically detect the presence of this method, and call it whenever data is needed for a popup menu.
The parameters are:
- controlId - the control identifier of the WebDrillDown instance.
- requestPath - the path to the data required for the popup menu.
If the data is available, it may be returned as a JSON string or JavaScript object.
If the data needs to be fetched, return
null and the data can be processed later by calling the following client-side method:
function cwddProcessResponse(controlId, responseData)
This method is implemented in the WebDrillDown library.
The parameters are:
- controlId - the control identifier of the WebDrillDown instance.
- responseData - the popup information as a JSON string or JavaScript object.
For demonstration purposes, the first popup menu fetches its data immediately and all other menus simulate an asynchronous loading of the data.
In this sample the WebDrillDown is allowing you to select a datacenter server, organized by region, location and role.
Clicking the "Submit" button will send the full path for your selection to the server and it will be displayed below:
Click the "Reset" link to clear your selection.