|
|

楼主 |
发表于 2022-10-27 11:13:14
|
显示全部楼层
$('#exampleTable').bootstrapTable(
{
method : 'get', // 服务器数据的请求方式 get or post
url : prefix + "/itemList", // 服务器数据的加载地址
iconSize : 'outline',
toolbar : '#exampleToolbar',
striped : true, // 设置为true会有隔行变色效果
dataType : "json", // 服务器返回的数据类型
singleSelect : true, // 设置为true将禁止多选
pageSize : 30, // 如果设置了分页,每页数据条数
pageNumber : 1, // 如果设置了分布,首页页码
sidePagination : "server", // 设置在哪里进行分页,可选值为"client" 或者
// "server"
clickEdit : true,
pagination : true, // 显示分页条
showColumns : false,
uniqueId:"f_id",
queryParams : function(params) {
return {
// 说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
limit : params.limit,
offset : params.offset,
f_pid : "no",
f_materielname : $("#searchName").val()
};
},
columns : [ {
field: 'Num',
title: '序号',
align: 'center',
valign: 'middle',
width : 40,
formatter: function (value, row, index) {
return index + 1;
}
},{
field : 'f_materielcode',
title : '物料编码',
width : 90
}, {
field : 'f_materielname',
title : '物料名称',
width : 150
}, {
field : 'f_specification',
title : '型号',
width : 90
}, {
field : 'f_unit',
title : '单位',
width : 60
}, {
field : 'f_price',
title : '价格',
width : 80
}, {
field : 'f_numbers',
title : '数量',
width : 70
},{
title : '操作',
field : 'f_id',
align : 'center',
events: operateEvents,
formatter : function(value, row, index) {
var e = '<button class="btn btn-primary btn-sm " title="删除" ><i class="fa fa-colse"></i></button> ';
return e;
}
}]
function deleteData(value) {
$('#exampleTable').bootstrapTable('removeByUniqueId', value);
}; |
|