Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / gist:3667321
Created September 7, 2012 15:47 — forked from ericf/gist:3666772
Using Y.ModelConsumer
// assumes existence of Y.UserModel
YUI.add('user-view', function (Y) {
Y.UserView = Y.Base.create('userView', Y.View, [ Y.ModelConsumer ], {
template: Y.Handlebars.templates['user'],
initializer: function () {
var user = this.get('user');
Y.namespace('tnsg5').Tile = Y.Base.create("tile", Y.Widget,[], {
initializer: function () {
this.dataSource = this.getDataSourceInstance();
var dsCfg = {
request: "cb={}",
callback: {
//HERE IS WHERE THE FUNCTION IS ADDED
success: Y.bind(this.onSuccessfulLoad, this)
/*
* Validator Attribute
*
* @attribute validators
* @type {object}
* @default {isNumber & customVal}
* @since 1.0.0
*/
validators : {
value : {