Bootstrap table
$('#LogTable').bootstrapTable('refresh');
$('#LogTable').bootstrapTable({
url: url,
method: "post",
sidePagination: 'client',
queryParams: queryParams,
responseHandler: responseHandler,//参数
striped: true,
pagination: true,
paginationFirstText: "首页",
paginationPreText: "上一页",
paginationNextText: "下一页",
paginationLastText: "末页",
toolbar:'#Toolbar',
onLoadSuccess: function (data) {
$("#search").attr('disabled',false);
},
onLoadError: function () { //加载失败时执行
alert("加载数据失败");
},
pageNumber: 1,
pageList: [10, 30, 50],
pageSize: 10,
columns: [{field: 'orderId', title: '', align: 'center', width: 100,height:120},
{field: 'serviceCode', title: '', align: 'center'},
{field: 'serviceName', title: '', align: 'center'},
{field: 'appid', title: '', align: 'center'},
{field: 'diffIp', title: '', align: 'center'},
{field: 'baseIp', title: '', align: 'center'},
{field: 'clientId', title: '', align: 'center'},
{field: 'diffTime', title: '', align: 'center',order:'desc'},
{field: 'logToken', title: '', align: 'center'},
{field: 'uid', title: '', align: 'center'},
{field: 'operate', title: '', align: 'center', events: "operateEvents", formatter: operateFormatter,width:100}],
onDblClickRow: function (row) {
},
onEditableSave: function (field, row, oldValue, $el) {
},
onDblClickCell: function (field, value, row, $el){
if (field === "diffTime"){
alert("*******************");
}else {
var newValue = value;
if ($('#tag').val().indexOf(field) > -1){
var tags = $('#tag').val().split(";");
$.each(tags,function (index,value) {
var tag = tags[index].split('=');
if (value !== ""&&tag[0]===field) {
tag[1] = newValue;
tags[index] = tag.join('=');
}
});
$('#tag').val(tags.join(';'));
}else {
$('#tag').val($('#tag').val()+field+'='+value+';');
}
}
// alert("*********"+value+"\n"+row+field);
}
});
}
Html Table:
$("#table").empty("");
$("#table").apppend("");