Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf8c331

Browse files
exposed sortedData, added sort change event in list/grid comp
1 parentf2400d2 commitbf8c331

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

‎client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ export function ListView(props: Props) {
369369
newData.splice(toIndex,0,movedItem);
370370

371371
children.listData.dispatchChangeValueAction(newData);
372+
children.onEvent.getView()('sortChange');
372373
};
373374

374375
// log.debug("renders: ", renders);

‎client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
withFunction,
3030
WrapContextNodeV2,
3131
}from"lowcoder-core";
32-
import{JSONArray,JSONValue}from"util/jsonTypes";
32+
import{JSONArray,JSONObject,JSONValue}from"util/jsonTypes";
3333
import{depthEqual,lastValueIfEqual,shallowEqual}from"util/objectUtils";
3434
import{CompTree,getAllCompItems,IContainer}from"../containerBase";
3535
import{SimpleContainerComp,toSimpleContainerData}from"../containerBase/simpleContainerComp";
@@ -40,6 +40,7 @@ import { listPropertyView } from "./listViewPropertyView";
4040
import{getData}from"./listViewUtils";
4141
import{withMethodExposing}from"comps/generators/withMethodExposing";
4242
import{SliderControl}from"@lowcoder-ee/comps/controls/sliderControl";
43+
import{eventHandlerControl,sortChangeEvent}from"@lowcoder-ee/comps/controls/eventHandlerControl";
4344

4445
constchildrenMap={
4546
noOfRows:withIsLoadingMethod(NumberOrJSONObjectArrayControl),// FIXME: migrate "noOfRows" to "data"
@@ -62,6 +63,7 @@ const childrenMap = {
6263
horizontal:withDefault(BoolControl,false),
6364
minHorizontalWidth:withDefault(RadiusControl,'100px'),
6465
enableSorting:withDefault(BoolControl,false),
66+
onEvent:eventHandlerControl([sortChangeEvent]asconst),
6567
};
6668

6769
constListViewTmpComp=newUICompBuilder(childrenMap,()=><></>)
@@ -183,6 +185,15 @@ ListViewPropertyComp = withExposingConfigs(ListViewPropertyComp, [
183185
returndata;
184186
},
185187
}),
188+
depsConfig({
189+
name:"sortedData",
190+
desc:trans("listView.dataDesc"),
191+
depKeys:["listData"],
192+
func:(input)=>{
193+
const{ data}=getData(input.listDataasJSONObject[]);
194+
returndata;
195+
},
196+
}),
186197
newCompDepsConfig(
187198
"pageNo",
188199
(comp)=>({index:comp.children.pagination.children.pageNo.exposingNode()}),

‎client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export function listPropertyView(compType: ListCompType) {
5555

5656
{(useContext(EditorContext).editorModeStatus==="logic"||useContext(EditorContext).editorModeStatus==="both")&&(
5757
<Sectionname={sectionNames.interaction}>
58+
{children.onEvent.getPropertyView()}
5859
{hiddenPropertyView(children)}
5960
{showDataLoadingIndicatorsPropertyView(children)}
6061
{children.enableSorting.propertyView({

‎client/packages/lowcoder/src/comps/controls/eventHandlerControl.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ export const resetEvent: EventConfigType = {
489489
value:"reset",
490490
description:trans("event.resetDesc"),
491491
};
492-
492+
exportconstsortChangeEvent:EventConfigType={
493+
label:trans("event.sortChange"),
494+
value:"sortChange",
495+
description:trans("event.sortChangeDesc"),
496+
};
493497

494498
// Meeting Events
495499

‎client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ export const en = {
463463
"resetDesc":"Triggers on Reset timer",
464464
"refresh":"Refresh",
465465
"refreshDesc":"Triggers on Refresh",
466+
"sortChange":"Sort Change",
467+
"sortChangeDesc":"Triggers on Sorting Changes",
466468
},
467469

468470

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp