//初始化数据
$.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;
}
2 个回复
tony2016 - 平常心
同求
zapoi
同求。+1