主页

Fastadmin--给添加编辑按钮,提交时增加确认弹框

砚台词   IP属地: 青海
0 点赞 0阅读 1685

js添加

api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"), function () {
                }, function () {
                }, function (success, error) {
                    layer.confirm('保存后,代码立即生效<br/>请仔细检查或先备份后操作!!', {
                        btn: ['确定', '取消'] //按钮
                    }, function (index) {
                        Form.api.submit($("form[role=form]"), function (data, ret) {
                            //如果我们需要在提交表单成功后做跳转,可以在此使用location.href="链接";进行跳转
                            setTimeout(function () {
                                parent.Layer.close(parent.Layer.getFrameIndex(window.name));
                                //刷新页面
                                window.parent.location.reload();
                            }, 1000);
                        });
                        Layer.close(index);
                    }, function () {
                    });
                    return false;
                });
            }
        },

© 著作权归作者所有,转载或内容合作请联系作者