Fast.api.open新增一个成功回调方法,监听窗口打开完毕后执行事件

新增一个回调方法,监听窗口打开完成了,然后就可以操作窗口内的元素了,例如往窗口内写入数据等
例如:
Fast.api.open('./test/test.html','打开窗口',{
                                            successCallback:function(index){
                                                console.log('窗口打开完成,成功回调,然后可以操作窗口内的元素了');
                                                var frame = Layer.getChildFrame('html', index);
                                                frame.find('[name="row[name]"]').val("写入内容")
                                            }
                                        })

Signed-off-by: Simon <siri@51siny.com>
pull/456/head
Simon 2023-11-14 03:36:35 +00:00 committed by Gitee
parent 6f35aff2eb
commit cf59da8111
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
area: area,
content: url,
zIndex: Layer.zIndex,
successCallback:null,
success: function (layero, index) {
var that = this;
//存储callback事件
@ -176,6 +177,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefine
// observer.disconnect();
}
}
that.successCallback && that.successCallback(index)
} catch (e) {
}