|
datatable绑定data通过scrollview进行分页操作,但data的CustomRefresh事件只能引发一次(也就是拖动时不会引发CustomRefresh事件,如果是用list控件是可以正常的),代码如下:
Model.prototype.cutomerListDataCustomRefresh = function(event) {
var self = this;
var success = function(data) {
var dataList = JSON.parse(data);
var append = event.options && event.options.append;
self.comp("cutomerListData").loadData(dataList, append);
self.comp("customerListView").refresh();
};
var error = function(evt) {
self.comp("messageDialog").show({
"title" : "温馨提示",
"message" : "获取数据失败!"
});
};
var params = [ '', '', event.offset / 10 + 1, 10, '', localStorage.getItem('username'), localStorage.getItem('password') ];
Baas.sendRequest({
"classname" : "clsCustomerMB_Svc",
"action" : "GetDataPage",
"parameter" : params
}, success, error);
}; |
|