Add find visible items for list and flowlayout
This commit is contained in:
@@ -41,6 +41,7 @@ class FlowDemo extends Panel {
|
||||
}).also(it => {
|
||||
if (idx == 15) {
|
||||
it.fullSpan = true
|
||||
it.identifier = "fullSpan"
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -62,7 +63,14 @@ class FlowDemo extends Panel {
|
||||
height: 50,
|
||||
fullSpan: true,
|
||||
layoutConfig: layoutConfig().configWidth(LayoutSpec.MOST),
|
||||
})
|
||||
}),
|
||||
onScrollEnd: async () => {
|
||||
const ret = await flowView.findCompletelyVisibleItems(context)
|
||||
loge('completelyVisible Items is:', ret)
|
||||
|
||||
const ret2 = await flowView.findVisibleItems(context)
|
||||
loge('visible Items is:', ret2)
|
||||
}
|
||||
}).in(rootView)
|
||||
|
||||
}
|
||||
|
@@ -111,6 +111,12 @@ class ListVM extends ViewModel<ListModel, ListVH> {
|
||||
state.data = state.data.concat(ret.data)
|
||||
state.offset = state.data.length
|
||||
})
|
||||
},
|
||||
onScrollEnd: async () => {
|
||||
const ret = await vh.list.findCompletelyVisibleItems(context)
|
||||
loge('completelyVisible Items is:', ret)
|
||||
const ret2 = await vh.list.findVisibleItems(context)
|
||||
loge('visible Items is:', ret2)
|
||||
}
|
||||
})
|
||||
loadData(state.offset).then(ret => {
|
||||
|
Reference in New Issue
Block a user