Last active
August 29, 2015 14:23
-
-
Save thomasJang/9c2a4e8564a1b3bb5d4a to your computer and use it in GitHub Desktop.
AXISJ bindSelector - onsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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