Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created May 21, 2012 14:52
Show Gist options
  • Save lsmith/2762744 to your computer and use it in GitHub Desktop.
Save lsmith/2762744 to your computer and use it in GitHub Desktop.
var datasource = new Y.DataSource.IO({ source: ... });
datasource.on('data', function (e) {
var raw = Y.JSON.parse(e.data),
data = [],
key;
for (key in raw.pathToDataObject) {
if (raw.pathToDataObject[key]) {
data.push(raw.pathToDataObject[key]);
}
}
e.data = data; // or e.pathToObject = data
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment