$(document).on('click','.btn', function (event) {
var url = $(this).attr('data-url');
if(!url) return false;
var msg = $(this).attr('data-title');
var width = $(this).attr('data-width');
var height = $(this).attr('data-height');
var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%'];
var options = {
shadeClose: false,
shade: [0.3, '#393D49'],
area: area,
callback:function(value){
//這個value就是傳上來的值
console.log(value);
}
};
Fast.api.open(url,msg,options);
});
在子窗體的js里加,本身如果要綁定事件是:
Controller.api.bindevent();
但是如果要傳值,可以改成以下:
//給按鈕添加點擊事件
$(document).on('click', '.btn-band', function () {
var ids = Table.api.selectedids(table); //獲取選中的id,獲取到的是個數組
Fast.api.close(ids);//這里是重點,將這個ids 傳至父頁面
});
