$(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 传至父页面
});