@@ -37,6 +37,7 @@ import { ContextContainerComp } from "./contextContainerComp";
3737import { ListView } from "./listView" ;
3838import { listPropertyView } from "./listViewPropertyView" ;
3939import { getData } from "./listViewUtils" ;
40+ import { withMethodExposing } from "comps/generators/withMethodExposing" ;
4041
4142const childrenMap = {
4243 noOfRows : withIsLoadingMethod ( NumberOrJSONObjectArrayControl ) , // FIXME: migrate "noOfRows" to "data"
@@ -151,11 +152,11 @@ export class ListViewImplComp extends ListViewTmpComp implements IContainer {
151152
152153const ListViewRenderComp = withViewFn ( ListViewImplComp , ( comp ) => < ListView comp = { comp } /> ) ;
153154const ListPropertyView = listPropertyView ( "listView" ) ;
154- const ListViewPropertyComp = withPropertyViewFn ( ListViewRenderComp , ( comp ) => {
155+ let ListViewPropertyComp = withPropertyViewFn ( ListViewRenderComp , ( comp ) => {
155156 return < ListPropertyView comp = { comp } /> ;
156157} ) ;
157158
158- export const ListViewComp = withExposingConfigs ( ListViewPropertyComp , [
159+ ListViewPropertyComp = withExposingConfigs ( ListViewPropertyComp , [
159160 new CompDepsConfig (
160161 "items" ,
161162 ( comp ) => ( { data : comp . itemsNode ( ) } ) ,
@@ -180,6 +181,22 @@ export const ListViewComp = withExposingConfigs(ListViewPropertyComp, [
180181 NameConfigHidden ,
181182] ) ;
182183
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+
183200export function defaultListViewData ( compName : string , nameGenerator : NameGenerator ) {
184201 return {
185202 noOfRows :
0 commit comments