自定义按钮集合

128 阅读1分钟

buttons: function () { return { btnAdd: { icon: 'glyphicon glyphicon-plus', event: function () { // alert('添加') ("#modal-title").html("添加文章"); ("#modal-id").modal("show"); }, attributes: { title: "add", // "data-toggle": "modal", // href: "#modal-id" } }, btnDel: { icon: 'glyphicon glyphicon-remove', event: function () { //选区所有选中行对应的绑定数据 var ids = (".table").bootstrapTable("getSelections"); console.log(ids); if (ids.length !== 0) { .ajax({ url: "http://localhost:3000/content", type: "DELETE", data: { _id: ids }, success: function (res) { if (res.status === 200) { load(); } } }) } }, attributes: { title: "remove" } } } }