当前位置: 首页> 娱乐> 明星 > fastadmin自定义弹框,以及回调函数等问题,

fastadmin自定义弹框,以及回调函数等问题,

时间:2025/7/11 2:53:12来源:https://blog.csdn.net/xxpxxpoo8/article/details/141057897 浏览次数:0次

效果图

在这里插入图片描述

1, 代码

弹框中使用弹框

弹框1代码主要代码

	<div class="form-group ccol-xs-12 col-sm-2" style="text-align: right"><a href="#" data-url="{:url('user/add')}"  class="btn btn-info" id="addVendor" role="button">Add Vendor</a></div>

弹框2主要代码

<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action=""><input type="hidden" id="agency_code" name="row[agency_code]" value=""><div class="form-group col-xs-12 col-sm-6"><label for="owner" class="control-label col-xs-12 col-sm-2" style="padding:0">Owner *</label><div class="col-xs-12 col-sm-8"><input type="text"  class="form-control" id="owner" name="row[owner]"  value="" data-rule="required" /></div></div>......
</form>

js 主要代码

注意事项

  1. bind一定要使用 Form.api.bindevent() 不要使用 Controller.api.bindevent(); 这个绑定,不然回调没有效果
  2. function (data,ret) {} 这个data,ret 这两个值是后台传过来的
    data: 对应下面后端数据
    在这里插入图片描述
    ret:对应整体后端返回的json数据
    在这里插入图片描述

vendors: function () {Form.api.bindevent($("form[role=form]"),function (data,ret) {console.log('=================')console.log(data)console.log(ret)Fast.api.close(data);//这里是重点});},edit: function () {$(document).on("click", "#addVendor", function () {Fast.api.open("booth_merch/vendors", "Add Vendors", {area:['800px','500px'],offset: '100px',callback:function(value){console.log('edit');console.log(value);}});Fast.api.layerfooter();});Controller.api.bindevent();},
关键字:fastadmin自定义弹框,以及回调函数等问题,

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: