else闭包,如下拉框数据
如果缓存中有数据 则直接读缓存,如果没有 在进行查询
var CachedSearchData = (
function(){
var cacheData = [], count=cacheData.length;
return {
getSearchData:function(id){
if(id in cacheData){
return cacheData[id];
}else{
alert('search in database')
}
},
clearSearchData:function(id){
if(dsid in cache){
cache[dsid].clearSelection();
}
}
}
}
)