From 022fd1eed77be19fb048c2df74f12fcd8f5cfa89 Mon Sep 17 00:00:00 2001 From: sunhao Date: Wed, 6 Dec 2023 18:48:17 +0800 Subject: [PATCH] * datatable: refactor dragUl with zui sortable component. --- module/datatable/ui/ajaxcustom.html.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module/datatable/ui/ajaxcustom.html.php b/module/datatable/ui/ajaxcustom.html.php index 9d714b3545..bebda6a4ae 100644 --- a/module/datatable/ui/ajaxcustom.html.php +++ b/module/datatable/ui/ajaxcustom.html.php @@ -26,7 +26,7 @@ function buildItem(array $item): wg $value = $isPercent ? strval(round((float)$item['width'] * 100)) : $item['width']; return li ( - setClass('row', 'items-center', 'border', 'px-5', 'h-9', 'cursor-move'), + setClass('row items-center ring px-5 h-9 cursor-move mt-px'), set('data-key', $item['name']), set('data-value', $item['width']), $isRequired ? setClass('required-col') : null, @@ -106,7 +106,11 @@ function buildBody(array $cols): form { if(empty($items)) continue; - $ul = dragUl(setClass("{$key}-cols")); + $ul = zui::sortable + ( + set::_tag('ul'), + set::_class("{$key}-cols") + ); foreach($items as $item) $ul->add(buildItem($item)); $body->add($ul); }