| ... | ... | @@ -197,7 +197,7 @@ These class properties are converted to HTML attributes and sent to the browser |
|
|
|
|
|
|
|
### Updating the Main Chart or Report Content
|
|
|
|
|
|
|
|
As the user changes inputs in the browser application, the main chart or report requires updating. When an update is required, the browser makes a request to the server `reports/results/` URL, passing all of the user's inputs to the server. The server responds with JSON content created from the `result()` method for the particular chart type being viewed. This content was [described above](#reportchart-creation) and consists of an HTML string and list of objects for the browser to create. Here is the CoffeeScript code in `bmsapp.coffee` that requests that content from the server, inserts the HTML in the `results` div and then creates the requested browser objects (Highcharts charts, Highstock charts, and Dashboards.)
|
|
|
|
As the user changes inputs in the browser application, the main chart or report requires updating. When an update is required, the browser makes a request to the server `reports/results/` URL, passing all of the user's inputs to the server. The server responds with JSON content created from the `result()` method for the particular chart type being viewed. This content was described above in the Report/Chart Creation section and consists of an HTML string and list of objects for the browser to create. Here is the CoffeeScript code in `bmsapp.coffee` that requests that content from the server, inserts the HTML in the `results` div and then creates the requested browser objects (Highcharts charts, Highstock charts, and Dashboards.)
|
|
|
|
|
|
|
|
```coffee
|
|
|
|
# Updates the results portion of the page
|
| ... | ... | @@ -223,6 +223,4 @@ update_results = -> |
|
|
|
alert "Error Occurred: " + err
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
* HTML and object creation.
|
|
|
|
* Two JS files, main and dashboard, created with CoffeeScript |
|
|
\ No newline at end of file |
|
|
|
If an object is a 'dashboard', it is created by the CoffeeScript code in the [dashboard.coffee file](https://github.com/alanmitchell/bmon/blob/master/bmsapp/static/bmsapp/scripts/dashboard.coffee). |