Closed GoogleCodeExporter closed 8 years ago
Original comment by John.Jian.Fang@gmail.com
on 26 Jul 2010 at 9:03
The selector object should include methods such as selectByValue,
selectByIndex, selectByLabel, and so on.
var UiSelector = UiObject.extend({
init: function(){
this._super();
this.uiType = 'Selector';
this.tag = "select";
},
select: function(context, optionSelector){
var element = context.domRef;
var $sel = teJQuery(element);
//first, remove all selected element
$sel.find("option").removeAttr("selected");
//construct the select option
var opt = "option" + optionSelector;
//select the appropriate option
$sel.find(opt).attr("selected", "selected");
if (teJQuery.browser.msie) {
element.fireEvent("onchange");
} else {
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('change', true, true);
element.dispatchEvent(evObj);
}
}
});
Original comment by John.Jian.Fang@gmail.com
on 26 Jul 2010 at 9:06
use label and regular expression
Original comment by John.Jian.Fang@gmail.com
on 8 Aug 2010 at 12:49
Original issue reported on code.google.com by
John.Jian.Fang@gmail.com
on 26 Jul 2010 at 9:03