@@ -37,6 +37,7 @@ import { ContextContainerComp } from "./contextContainerComp";
37
37
import { ListView } from "./listView" ;
38
38
import { listPropertyView } from "./listViewPropertyView" ;
39
39
import { getData } from "./listViewUtils" ;
40
+ import { withMethodExposing } from "comps/generators/withMethodExposing" ;
40
41
41
42
const childrenMap = {
42
43
noOfRows : withIsLoadingMethod ( NumberOrJSONObjectArrayControl ) , // FIXME: migrate "noOfRows" to "data"
@@ -151,11 +152,11 @@ export class ListViewImplComp extends ListViewTmpComp implements IContainer {
151
152
152
153
const ListViewRenderComp = withViewFn ( ListViewImplComp , ( comp ) => < ListView comp = { comp } /> ) ;
153
154
const ListPropertyView = listPropertyView ( "listView" ) ;
154
- const ListViewPropertyComp = withPropertyViewFn ( ListViewRenderComp , ( comp ) => {
155
+ let ListViewPropertyComp = withPropertyViewFn ( ListViewRenderComp , ( comp ) => {
155
156
return < ListPropertyView comp = { comp } /> ;
156
157
} ) ;
157
158
158
- export const ListViewComp = withExposingConfigs ( ListViewPropertyComp , [
159
+ ListViewPropertyComp = withExposingConfigs ( ListViewPropertyComp , [
159
160
new CompDepsConfig (
160
161
"items" ,
161
162
( comp ) => ( { data : comp . itemsNode ( ) } ) ,
@@ -180,6 +181,22 @@ export const ListViewComp = withExposingConfigs(ListViewPropertyComp, [
180
181
NameConfigHidden ,
181
182
] ) ;
182
183
184
+ export const ListViewComp = withMethodExposing ( ListViewPropertyComp , [
185
+ {
186
+ method : {
187
+ name : "setPage" ,
188
+ description : "" ,
189
+ params : [ { name : "page" , type : "number" } ] ,
190
+ } ,
191
+ execute : ( comp , values ) => {
192
+ const page = values [ 0 ] as number ;
193
+ if ( page && page > 0 ) {
194
+ comp . children . pagination . children . pageNo . dispatchChangeValueAction ( page ) ;
195
+ }
196
+ } ,
197
+ } ,
198
+ ] )
199
+
183
200
export function defaultListViewData ( compName : string , nameGenerator : NameGenerator ) {
184
201
return {
185
202
noOfRows :
0 commit comments