|
楼主 |
发表于 2016-4-28 10:07:21
|
显示全部楼层
帮忙把这个解释下
Model.prototype.cityDataCustomRefresh = function(event){
var cityData = event.source;
$.ajax({
type: "GET",
url: require.toUrl('./json/cityData.json'),
dataType: 'json',
async: false,//使用同步方式,目前data组件有同步依赖
cache: false,
success: function(data){
cityData.loadData(data);//将返回的数据加载到data组件
},
error: function(){
throw justep.Error.create("加载数据失败");
}
});
};
//当前城市
Model.prototype.listClick = function(event){
var cityData=this.comp("cityData");
cityData.each(function(obj){
if(obj.row.val("fCurrent")==1){
cityData.setValue("fCurrent",0,obj.row);
}
});
cityData.setValue("fCurrent",1);
this.comp("windowReceiver").windowEnsure({"fName":cityData.getValue("fName")});
};
|
|