fastadmin 子窗體傳值到父窗體



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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM