Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Created February 9, 2012 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/1782297 to your computer and use it in GitHub Desktop.
Save brianjmiller/1782297 to your computer and use it in GitHub Desktop.
YUI: Building a select
_uiSetSuppliers: function (value, src) {
Y.log(Clazz.NAME + "::_uiSetSuppliers");
if (this._supplierSelectNode) {
this._supplierSelectNode.empty();
this._supplierSelectNode.append('<option value="">' + this.get("strings").choose_one_option_label + '</option>');
if (this.get("suppliers")) {
this.get("suppliers").each(
function (supplier) {
this.append('<option value="' + supplier.get("id") + '">' + supplier.get("display_label") + '</option>');
},
this._supplierSelectNode
);
}
}
},
_afterSupplierSelectChange: function (e) {
Y.log(Clazz.NAME + "::_afterSupplierSelectChange");
this.get("model").set("supplier", { id: e.target.get("value")} );
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment