* zin: add stickyActions to form.
This commit is contained in:
@@ -31,6 +31,7 @@ class form extends formBase
|
||||
'labelData?: array|object', // 表单项标签默认数据。
|
||||
'loadUrl?: string', // 动态更新 URL。
|
||||
'autoLoad?: array', // 自动更新策略。
|
||||
'stickyActions?: array|bool=false',// 是否固定操作按钮栏。
|
||||
'actionsClass?: string="form-group no-label"' // 操作按钮栏的 CSS 类。
|
||||
);
|
||||
|
||||
@@ -258,7 +259,16 @@ class form extends formBase
|
||||
|
||||
protected function buildActions(): wg|null
|
||||
{
|
||||
$sticky = $this->prop('stickyActions');
|
||||
$actions = parent::buildActions();
|
||||
|
||||
if($sticky)
|
||||
{
|
||||
$actions->setProp('zui-create', 'sticky');
|
||||
$actions->setProp('data-side', 'bottom');
|
||||
if(is_array($sticky)) $actions->add(setData($sticky));
|
||||
}
|
||||
|
||||
if($this->isLayout('horz') && !empty($actions)) $actions = div(setClass('form-row'), $actions);
|
||||
return $actions;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class formGridPanel extends formPanel
|
||||
'modeSwitcher' => true,
|
||||
'foldableItems' => null,
|
||||
'formID' => '$AUTO',
|
||||
'customBtn' => true
|
||||
'customBtn' => true,
|
||||
'stickyActions' => true
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class formPanel extends panel
|
||||
'url?: string', // 表单提交地址。
|
||||
'actions?: array', // 表单操作按钮,如果不指定则使用默认行为的 “保存” 和 “返回” 按钮。
|
||||
'actionsClass?: string="form-group no-label"', // 表单操作按钮栏类名。
|
||||
'stickyActions?: array|bool=false', // 是否固定操作按钮栏。
|
||||
'target?: string="ajax"', // 表单提交目标,如果是 `'ajax'` 提交则为 ajax,在禅道中除非特殊目的,都使用 ajax 进行提交。
|
||||
'submitBtnText?: string', // 表单提交按钮文本,如果不指定则使用 `$lang->save` 的值。
|
||||
'cancelBtnText?: string', // 表单取消按钮文本,如果不指定则使用 `$lang->goback` 的值。
|
||||
|
||||
Reference in New Issue
Block a user