fastadmin 獲取table選中行id
var ids = Table.api.selectedids(table);
fastadmin 獲取選中行數據
$("#table").bootstrapTable('getSelections')['0']
阻止默認事件
$('.btn-edit').click(function (e) {
e.preventDefault();
})
阻止冒泡事件
$('.btn-edit').click(function (e) {
e.stopPropagation();
})
獲取table頁面返回數據
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
responseHandler: function(res) {
// 處理后端返回的數據
var status = res.status; // 獲取其他字段// 返回處理后的數據
return {
total: res.total,
rows: res.rows
};
},
打開窗口
Fast.api.open("notification/complaint/edit1", "編輯", {
shadeClose: true,
shade: [0.5,'#393D49'],
area: ['100%','100%'],
callback:function(value){
return false;
// 在這里可以接收彈出層中使用`Fast.api.close(data)`進行回傳數據
}
});
確認彈窗
layer.confirm('確定提交選中的 1 項?!', {
btn: ['確定', '取消'],
cancel: function(index, layero) {
//點擊右上角叉號執行
console.log(111)
}
},function (index) {
//點擊確認執行
Layer.close(index); //關閉彈窗
},function (){
//點擊取消執行
console.log(333)
})