Skip to content

Instantly share code, notes, and snippets.

@thomasJang
Last active August 29, 2015 14:23
Show Gist options
  • Save thomasJang/9c2a4e8564a1b3bb5d4a to your computer and use it in GitHub Desktop.
Save thomasJang/9c2a4e8564a1b3bb5d4a to your computer and use it in GitHub Desktop.
AXISJ bindSelector - onsearch
var iiac_cat_options = [];
$("#itemMapCd").bindSelector({
appendable:false,
//options: options,
onsearch: function(objID, objVal) {
var options = [];
if(objVal == ""){
options = [].concat(iiac_cat_options);
return {options:options};
}else{
objVal = objVal.replace(/\//g, "\\\/");
var sw = axf.consonantKR((objVal || "").dec());
var reAt = new RegExp("^" + sw + ".*", "i");
for(var i=0, l=iiac_cat_options.length;i<l;i++){
if (reAt.test(iiac_cat_options[i].optionValue) || reAt.test(iiac_cat_options[i].lcatNm)) {
options.push(iiac_cat_options[i]);
}
}
return {options:options};
}
},
onChange:function(){
if(this.selectedOption) {
axdom("#iiaDesc").html(this.selectedOption.desc);
}
//toast.push(this.selectedOption);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment