MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / refresh

Method refresh

packages/core/ui/list-view/index.ios.ts:670–690  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

668 }
669
670 public refresh() {
671 // clear bindingContext when it is not observable because otherwise bindings to items won't reevaluate
672 this._map.forEach((view, nativeView, map) => {
673 if (!(view.bindingContext instanceof Observable)) {
674 view.bindingContext = null;
675 }
676 });
677 this._headerMap.forEach((view, nativeView, map) => {
678 if (!(view.bindingContext instanceof Observable)) {
679 view.bindingContext = null;
680 }
681 });
682
683 if (this.isLoaded) {
684 this.nativeViewProtected.reloadData();
685 this.requestLayout();
686 this._isDataDirty = false;
687 } else {
688 this._isDataDirty = true;
689 }
690 }
691
692 public isItemAtIndexVisible(itemIndex: number): boolean {
693 const indexes: NSIndexPath[] = Array.from(this.nativeViewProtected.indexPathsForVisibleRows);

Calls 2

requestLayoutMethod · 0.95
forEachMethod · 0.80

Tested by

no test coverage detected