Famo.us how to create a Select Surface or something equivalent -
Famo.us how to create a Select Surface or something equivalent -
i need select box options , on select / on alter can populate sec select box.
my first instinct create 1 using surface click event , rendercontroller / scrollview create drop downwards appear. works wonderfully except if leave , come page zindex of scrollview breaks , scrolls on container size.
its bug need deal other problem little iphone screen size conventional drop downs eat much screen real-estate.
this stackoverflow famo.us: how handle textbox.onchange events had great hints on how edit inputsurface. thought using , looking @ code surface no luck.
any ideas on how deal lack of select surface?
you can access value property within callback function:
function selectsurface(options) { surface.apply(this, arguments); this.onchange = options.onchange; this._superdeploy = surface.prototype.deploy; selectsurface.prototype.elementtype = 'select'; } selectsurface.prototype = object.create(surface.prototype); selectsurface.prototype.constructor = selectsurface; selectsurface.prototype.deploy = function deploy(target) { target.onchange = this.onchange; this._superdeploy(target); }; var regionselector = new selectsurface({ size:[140,40], onchange: regionselect(), content: '<option disabled selected style="display:none;">region</option><option value="central">central</option><option value="northern">northern</option><option value="pacific">pacific</option><option value="southern">southern</option><option value="western">western</option>', }); var regionselect = function(){ homecoming function() { alert(this.value); } }; famo.us
Comments
Post a Comment