void;
minHorizontalWidth?: string;
horizontalWidth: string;
+ enableSorting?: boolean;
};
function ListItem({
@@ -154,6 +172,7 @@ function ListItem({
scrollContainerRef,
minHeight,
horizontalGridCells,
+ enableSorting,
} = props;
// disable the unmount function to save user's state with pagination
@@ -195,6 +214,7 @@ function ListItem({
overflow={"hidden"}
minHeight={minHeight}
enableGridLines={true}
+ enableSorting={enableSorting}
/>
);
@@ -248,6 +268,8 @@ export function ListView(props: Props) {
};
}, [children.pagination, totalCount]);
+ const enableSorting = useMemo(() => children.enableSorting.getView(), [children.enableSorting]);
+
useEffect(() => {
children.listData.dispatchChangeValueAction(data);
}, [JSON.stringify(data)]);
@@ -313,6 +335,7 @@ export function ListView(props: Props) {
unMountFn={unMountFn}
horizontalWidth={`${100 / noOfColumns}%`}
minHorizontalWidth={horizontal ? minHorizontalWidth : undefined}
+ enableSorting={enableSorting}
/>
);
})}
@@ -365,15 +388,20 @@ export function ListView(props: Props) {
$isGrid={noOfColumns > 1}
$autoHeight={autoHeight}
>
-
- String(colIdx))
- }
- >
- {renders}
-
-
+ {!enableSorting
+ ? renders
+ : (
+
+ String(colIdx))
+ }
+ >
+ {renders}
+
+
+ )
+ }
)}
>
diff --git a/client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx b/client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx
index f23edafe4b..00f6807cf8 100644
--- a/client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx
+++ b/client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx
@@ -61,6 +61,7 @@ const childrenMap = {
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
horizontal: withDefault(BoolControl, false),
minHorizontalWidth: withDefault(RadiusControl, '100px'),
+ enableSorting: withDefault(BoolControl, false),
};
const ListViewTmpComp = new UICompBuilder(childrenMap, () => <>>)
diff --git a/client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx b/client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx
index 6e9a4b865d..22e288d737 100644
--- a/client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx
+++ b/client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx
@@ -57,6 +57,9 @@ export function listPropertyView(compType: ListCompType) {
{hiddenPropertyView(children)}
{showDataLoadingIndicatorsPropertyView(children)}
+ {children.enableSorting.propertyView({
+ label: trans('listView.enableSorting'),
+ })}
)}
diff --git a/client/packages/lowcoder/src/i18n/locales/en.ts b/client/packages/lowcoder/src/i18n/locales/en.ts
index 735b797d4e..acc6488669 100644
--- a/client/packages/lowcoder/src/i18n/locales/en.ts
+++ b/client/packages/lowcoder/src/i18n/locales/en.ts
@@ -2598,7 +2598,8 @@ export const en = {
"itemDataNameDesc": "The Variable Name Referring to the Item's Data Object, Default as {default}",
"itemsDesc": "Exposing Data of Components in List",
"dataDesc": "The JSON Data Used in the Current List",
- "dataTooltip": "If You just Set a Number, This Field Will Be Regarded as Row Count, and the Data Will Be Regarded as Empty."
+ "dataTooltip": "If You just Set a Number, This Field Will Be Regarded as Row Count, and the Data Will Be Regarded as Empty.",
+ "enableSorting": "Allow Sorting"
},
"navigation": {
"addText": "Add Submenu Item",
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1644.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy