首先用layui获取选中行数据
var checkStatus = table.checkStatus('idTest'); //idTest 即为基础参数 id 对应的值
获取选中行后,获取选中行的每一行ID,for循环拼接ID
var CommodityIds = "";
for (var i = 0; i < checkStatus.data.length; i++) {
CommodityIds += checkStatus.data[i].CommodityID + ';';
}
CommodityIds = CommodityIds.substring(0, CommodityIds.length - 1);
layer.confirm("选中" + checkStatus.data.length + "商品", function (data) {
返回结果
})
})
传到控制器,声明private函数,分割字符,foreach遍历每一个字符
查询信息
New一张新的实体类,存放信息
获取想要的值,保存到listCommoity
保存到Session里,
在从Session拿到数据分页,调用刚刚的函数
分页,返回数据。