商汇粹外网资源平台

搜索
查看: 1005|回复: 1

bootstrapTable removebyuniqueid 删除当前行小坑解决办法

[复制链接]

该用户从未签到

3

主题

6

帖子

43

积分

新手上路

Rank: 1

积分
43
发表于 2022-10-27 10:31:34 | 显示全部楼层 |阅读模式
回复

使用道具 举报

该用户从未签到

3

主题

6

帖子

43

积分

新手上路

Rank: 1

积分
43
 楼主| 发表于 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);
};
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表