Skip to content

Instantly share code, notes, and snippets.

@juandopazo
Created June 7, 2012 23:44
Show Gist options
  • Select an option

  • Save juandopazo/2892445 to your computer and use it in GitHub Desktop.

Select an option

Save juandopazo/2892445 to your computer and use it in GitHub Desktop.
An idea about how Y.Dialog could be made
Y.Dialog = Y.Base.create('dialog', Y.Widget, [/* same extensions as Panel */, Y.WidgetForm], {
initializer: function (config) {
// deal with inyecting a View inside the body of WidgetStdMod
// config.data could have the initial data for the form
}
});
var dialog = new Y.Dialog({
template: someTemplate,
data: someData
}).render();
// dialog.form is an instance of Model
// (I'm still not very familiar with the app framework, so this is a rough idea)
dialog.form.get('foo'); // returns the value of the 'foo' input
dialog.form.toJSON(); // models get this one for free
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment