Skip to content

Instantly share code, notes, and snippets.

View ItsAsbreuk's full-sized avatar

Marco Asbreuk ItsAsbreuk

View GitHub Profile
/**
* Example reading multiple databaserequests simultaniously
* while calling the callback-Fn only when all request have finished
*
* In this example, we want to read a table with all area's in a specific country.
* From there on, from every area we need to know the citienames and population, which resides in a second table.
*
* In some situations, this might be done with one statement using INNER JOIN, but there are cases where you need multiple requests. (performance or limitation)
*
* The array is build, has this form:
YUI({gallery: 'gallery-2014.03.12-23-08'}).use('chart', 'lazy-model-list', 'gallery-io-utils', 'gallery-itsamodellistsyncpromise', function(Y) {
var URL = "../data/PumpReports.php",
cyclesChart, chartData;
cyclesChart = new Y.Chart({
categoryKey: "dateTime",
categoryType: "time",
seriesKeys:["temperature"],
axes: {
category: {
Y.namespace('Plugin').ChartDataSource = Y.Base.create('chartDataSource', Y.Plugin.DataTableDataSource, [], {
/**
* Callback function passed to DataSource's sendRequest() method populates
* an entire DataTable with new data, clearing previous data, if any.
*
* @method onDataReturnInitializeTable
* @param e {EventFacade} DataSource Event Facade object.
*/
onDataReturnInitializeTable : function(e) {