web:List add reload function

This commit is contained in:
wangxiangyuan 2023-08-29 16:07:17 +08:00 committed by osborn
parent 44ba80bc90
commit 704a31f80c

View File

@ -40,10 +40,24 @@ export class DoricListNode extends DoricSuperNode {
}
}
reload() {
this.reset()
const ret = this.pureCallJSResponse("renderBunchedItems", 0, this.itemCount) as DVModel[]
ret.forEach(e => {
const viewNode = DoricViewNode.create(this.context, e.type) as DoricListItemNode
viewNode.viewId = e.id
viewNode.init(this)
viewNode.blend(e.props)
this.view.appendChild(viewNode.view)
return viewNode
})
}
reset() {
while (this.view.lastElementChild) {
this.view.removeChild(this.view.lastElementChild)
}
this.childNodes = []
}
onBlending() {