From a7b0d4e7881aa10c413183799ae030d954d65451 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 13 Jun 2023 16:46:37 +0800 Subject: [PATCH] * zin: support for setting ajax option in form widgets. --- lib/zin/wg/formbase/v1.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/zin/wg/formbase/v1.php b/lib/zin/wg/formbase/v1.php index 4db5459955..7d894c076c 100644 --- a/lib/zin/wg/formbase/v1.php +++ b/lib/zin/wg/formbase/v1.php @@ -28,10 +28,7 @@ class formBase extends wg 'cancelBtnText?: string', // 表单取消按钮文本,如果不指定则使用 `$lang->goback` 的值。 'back?: string="APP"', // 表单返回行为 'backUrl?: string', // 表单返回链接 - ); - - protected static $defaultProps = array( - 'actions' => array('submit', 'cancel') + 'ajax?:array' // Ajax 表单选项 ); protected function buildActions(): wg|null @@ -84,7 +81,10 @@ class formBase extends wg protected function buildAfter(): array { $after = parent::buildAfter(); - if($this->prop('target') === 'ajax') $after[] = zui::ajaxForm(set::_to('#' . $this->id())); + if($this->prop('target') === 'ajax') + { + $after[] = zui::ajaxForm(set::_to('#' . $this->id()), set($this->prop('ajax'))); + } return $after; }