js: list add reload api

This commit is contained in:
pengfei.zhou
2022-08-16 17:44:03 +08:00
committed by osborn
parent 7dda15efbd
commit 3de2162ef6
12 changed files with 56 additions and 3 deletions

View File

@@ -566,4 +566,16 @@ - (void)subNodeContentChanged:(DoricViewNode *)subNode {
[subNode.view.doricLayout apply];
[super subNodeContentChanged:subNode];
}
- (void)reload {
self.loadAnchor = -1;
[self.itemViewIds.allValues forEach:^(NSString *obj) {
[self removeSubModel:obj];
}];
[self.itemViewIds removeAllObjects];
dispatch_async(dispatch_get_main_queue(), ^{
self.rowCount = self.itemCount + (self.loadMore ? 1 : 0);
[self.view reloadData];
});
}
@end