|
我在Model的onParamsReceive事件中接收了几个参数值,想作为列表的查询条件再传到后台去.
现在的问题是:值接收到了,也保存到成员属性中了,但在data组件的onCustomRefersh事件中获取不到这些值,都是空的。
我想请教一下这两个事件的次序是什么样?
var thisObject;
var name;
var id;
var action;
var year;
Model.prototype.todoDataCustomRefresh = function(event){
baas.sendRequest({
"url" : "/kpi",
"action" : action,
"async" : false,
"params" : {
"name" : name,
"id" : id,
"userid" : localStorage.getItem("userid"),
"year" : year,
"limit" : event.limit,
"offset" : event.offset,
"columns" : baas.getDataColumns(thisObject.comp("todoData"))
},
"success" : function(data) {
thisObject.comp("todoData").loadData(data,false);
}
});
};
Model.prototype.modelParamsReceive = function(event){
name = event.params.name;
id = event.params.id;
action = event.params.action;
year = event.params.year;
// baas.sendRequest({
// "url" : "/kpi",
// "action" : action,
// "async" : false,
// "params" : {
// "name" : name,
// "id" : id,
// "userid" : localStorage.getItem("userid"),
// "year" : year,
// "limit" : event.limit,
// "offset" : event.offset,
// "columns" : baas.getDataColumns(thisObject.comp("todoData"))
// },
// "success" : function(data) {
// thisObject.comp("todoData").loadData(data,false);
// }
// });
}; |
|