一条数据中需要遍历多条数据,页面遍历方法

   使用的是jgrid表格,bootstrap页面

{name:'listportDetect',index:'listportDetect', width:50,editable: true,formatter: function (cellvalue, options, rowObject) {
var res = "";
if(rowObject.listportDetect){
for(x in rowObject.listportDetect){
if(rowObject.listportDetect[x].status == 1){
// res += "<p><button class='btn btn-xs btn-info'>"+rowObject.listportDetect[x].port+"</button></p>"; //绿色,通
res += "<label title="+rowObject.listportDetect[x].port+'&nbsp;:&nbsp;可达'+" style='height:30px;width:150px;background:#90EE90;text-align:center;margin-top:10px;outline:none;color:#FFFFFF;border-width:0px;border-style:none;border-radius: 10px;'>"+
"<p style='margin-top:4px;'>"+rowObject.listportDetect[x].name+
"&nbsp;&nbsp;&nbsp;&nbsp;"+
"<a href='#modal-portTable' class='tooltip-success' data-rel='tooltip' data-toggle='modal' title='编辑' οnclick='editOpenPortDetect(\""+rowObject.listportDetect[x].pkid+"\",\""+rowObject.listportDetect[x].port+"\",\""+rowObject.listportDetect[x].name+"\")'>"+
"<span class='white'>"+
"<i class='icon-edit-sign bigger-140'>"+"</i>"+
"</span></a>"+
"&nbsp;&nbsp;"+
"<i title='删除' class='icon-remove-sign bigger-150' οnclick='removePortDetect("+rowObject.listportDetect[x].pkid+")'>"+
"</i></p></label>&nbsp;&nbsp;";

}
}
}
return res;
}},

 

转载于:https://www.cnblogs.com/chen-yun/p/6196798.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值