April小小
April小小
  • 发布:2016-07-15 14:31
  • 更新:2016-09-13 16:55
  • 阅读:1886

选项卡切换+下拉刷新如果数据初始化的数量在一页内,如何去掉最下面的上拉加载更多

分类:MUI

//初始化数据
$.each(document.querySelectorAll(".mui-table-view-chevron"), function(index,pullRefreshEl) {
setTimeout(function() {
var PrStatus=pullRefreshEl.getAttribute("PrStatus");
//mui.alert(PrStatus);
var item=document.getElementById("item"+PrStatus);
var Fragment=createFragment3(pullRefreshEl,0,PrStatus,true,item);
//alert(frame.innerHTML);
pullRefreshEl.appendChild(Fragment);

                                }, 1000);  
                });  

var createFragment3 = function(ul,Index,PrStatus,initial,item){
//mui.alert(count);
var fragment = document.createDocumentFragment();
var table=document.createElement("div");
//table.className="mui-table-view-chevron";

                    var pagecondition = { 'PageIndex':Index,'PageSize':pageSize,'PrStatus':PrStatus};  
                mui.ajax('http://192.168.1.125:8066/api/Repair/RepairList',{  
                    data:pagecondition,  
                    dataType:'json',//服务器返回json格式数据  
                    type:'post',//HTTP请求类型  
                    timeout:100000,//超时时间设置为10秒;  
                    //headers:{'Content-Type','application/json'},                  
                    success:function(data){  
                        var returnJson=eval(JSON.parse(data));  

                        for (var i = 0, len = returnJson.Items.length; i < len; i++)  
                        {  
                            var ul =document.createElement('ul');  
                            ul.className='mui-table-view';  
                            ul.id=returnJson.Items[i].Id;  
                            var li1 = document.createElement('li');  
                            li1.className = 'mui-table-view-cell';  
                            li1.innerHTML='<i class=\"icon-file\"></i>'+returnJson.Items[i].Content;  
                            ul.appendChild(li1);  
                            var li2=document.createElement('li');  
                            li2.className='mui-table-view-cell';  
                            li2.innerHTML='<i class="icon-home"></i>'+returnJson.Items[i].Address;  
                            ul.appendChild(li2);  
                            var li3=document.createElement("li");  
                            li3.className='mui-table-view-cell';  
                            li3.innerHTML="<span class=\"mui-btn mui-btn-purple\" onclick=\"javascript:window.location.href='repairDetail.html?id='"+returnJson.Items[i].Id+"\">查看</span><i class=\"icon-time\"></i>"+returnJson.Items[i].PrTime  

                            ul.appendChild(li3);  
                            //mui.alert(ul.innerHTML);  
                            table.appendChild(ul);   
                        };  
                        //maxpageSize=Math.floor((returnJson.TotalCount+1)/pageSize);  
                        if(initial)  
                        {  
                            var textnode=document.createTextNode("("+returnJson.TotalCount+")");  
                            item.appendChild(textnode);  
                        }  
                    },  
                    error:function(xhr,type,errorThrown){  
                        //异常处理;  
                        mui.alert(xhr);  
                    }  

                });  

                return table;  
                }  
2016-07-15 14:31 负责人:无 分享
已邀请:
tony2016

tony2016 - 平常心

同求

zapoi

zapoi

同求。+1

该问题目前已经被锁定, 无法添加新回复