|

楼主 |
发表于 2018-7-10 17:43:01
|
显示全部楼层
本帖最后由 xichuinfo 于 2018-7-10 17:46 编辑
- Model.prototype.dataCustomRefresh = function(event){
- var newsData = event.source;
- var limit = newsData.limit;
- var page = newsData.getOffset() / limit + 1;
-
- var self = this;
-
- if (page == 1) {
- //显示遮罩
- this.comp("popOverLoading").show();
- }
-
- $.ajax({
- url : localStorage.getItem("urlpre") + "",
- contentType : "application/x-www-form-urlencoded; charset=utf-8",
- type : "post",
- dataType : "json",
- async : true,
- cache : false,
- data : {
- page : page,
- limit : limit,
- classId : this.classId,
- searchKey : this.searchKey,
- },
- success : function(ret) {
- if (page == 1) {
- newsData.loadData(ret[0], false);
- newsData.setTotal(ret[0].rows.length * page + limit);
- } else {
- newsData.loadData(ret[0], true);
- newsData.setTotal(ret[0].rows.length * page + limit);
- }
- //隐藏遮罩
- self.comp("popOverLoading").hide();
- },
- error : function(XMLHttpRequest, textStatus, errorThrown){
- //alert(XMLHttpRequest.status);
- //alert(XMLHttpRequest.readyState);
- //alert(textStatus);
-
- justep.Util.hint("加载数据失败。",
- {
- type : "info",
- position : "bottom"
- });
- }
- });
- };
复制代码
|
|