目前的问题是我的列表中有重复行,不能以字段删。
如何按照序号删除?
1 columns: [ 2 {
field: 'Num', 3 title: '序号',//标题 可不加 4 align: 'center', 5 valign: 'middle', 6 formatter: function (value, row, index) { 7 return index + 1; 8 } 9 }, 10 { 11 title: '步骤名', 12 field: 'SDName', 13 align: 'center', 14 valign: 'middle' 15 }, 16 { 17 title: 'SDId', 18 field: 'SDId', 19 align: 'center', 20 valign: 'middle' 21 //, 22 //visible: false 23 }, 24 25 //操作栏的格式化 26 function actionFormatter(value, row, index) { 27 var id = value; 28 var result = ""; 29 var str = row.SDName + '_' + row.SDId + '_' + row.SDDescription + '_' + row.SDType; 30 result += "<a href='javascript:;' class='btn btn-xs red' onclick=\"DeleteByIds('" + 31 (index+1) + "')\" title='删除'><span class='glyphicon glyphicon-remove'></span></a>"; 32 return result; 33 } 34 35 function DeleteByIds(index) { 36 $('#tableSelectedSteps').bootstrapTable('remove', { 37 filed: 'Num', 38 value: [parseInt(index)] 39 }); 40 }