//call this function in ontextchange event of textbox
function search(){
try{
if(frmCountryCodeList.txtSearch.text !== ""){
var searchArr = [];
for(var i = 0; i<gbl_country_code.length; i++){
if(gbl_country_code[i].lblCountry.toLowerCase().includes(frmCountryCodeList.txtSearch.text.toLowerCase())){
searchArr.push(gbl_country_code[i]);
}
}
frmCountryCodeList.segCountryCode.setData(searchArr);
}else{
frmCountryCodeList.segCountryCode.setData(gbl_country_code);
}
}catch(err){
dialogue("Err "+err);
}
}
function search(){
try{
if(frmCountryCodeList.txtSearch.text !== ""){
var searchArr = [];
for(var i = 0; i<gbl_country_code.length; i++){
if(gbl_country_code[i].lblCountry.toLowerCase().includes(frmCountryCodeList.txtSearch.text.toLowerCase())){
searchArr.push(gbl_country_code[i]);
}
}
frmCountryCodeList.segCountryCode.setData(searchArr);
}else{
frmCountryCodeList.segCountryCode.setData(gbl_country_code);
}
}catch(err){
dialogue("Err "+err);
}
}