Hosanna UI API v1.30.2-next
    Preparing search index...

    The IViewFragmentProvider interface provides methods for managing view fragments. View fragments are reusable components that can be used to create cells and other views. This interface allows for retrieving, creating, and releasing view fragments based on style keys. It also supports applying view statuses to fragments.

    interface IViewFragmentProvider {
        appendChild(parent: ISGNGroup, child: ISGNGroup): void;
        applyViewStatus(viewFragment: IViewFragment, status: ViewStatus): void;
        createViewFragmentsWithStyleKey(styleKey: string, count: number): void;
        getDanglingFragmentsForDebug(): JsonData[];
        getFragmentCounts(): IViewFragmentCounts;
        getViewFragmentByChildHid(childHid: string): undefined | IViewFragment;
        getViewFragmentByStyleKey(styleKey: string): undefined | IViewFragment;
        getViewFragmentForRow(
            row: IBaseCollectionViewRow,
        ): undefined | IViewFragment;
        markFragmentForRemoval(fragment: IViewFragment): void;
        registerViewFragmentCallback<
            T extends
                ISpecificViewFragmentCallbackHandler
                | ViewFragmentCallbackHandler,
        >(
            type: ViewFragmentCallbackType,
            name: string,
            handler: T,
        ): void;
        releaseFragment(view: IViewFragment): void;
        synchronizeRemovedViews(): void;
    }

    Implemented by

    Index

    Methods

    • Appends a child view to a parent if it is not already on stage. If the view is already on stage and was previously marked for removal, it will be unmarked without re-appending.

      Parameters

      Returns void

    • Applies a view status to a view fragment.

      Parameters

      Returns void

    • Creates multiple view fragments with a given style key.

      Parameters

      • styleKey: string

        The style key for the view fragments.

      • count: number

        The number of view fragments to create.

      Returns void

    • Debug-only: fragments currently checked out (not in available pool) with dangling hints.

      Returns JsonData[]

    • Retrieves a view fragment that contains a child view with the specified HID.

      Parameters

      • childHid: string

        The HID of the child view to find.

      Returns undefined | IViewFragment

      The view fragment or undefined if not found.

    • Retrieves a view fragment by its style key.

      Parameters

      • styleKey: string

        The style key of the view fragment.

      Returns undefined | IViewFragment

      The view fragment or undefined if not found.

    • Marks a fragment's view to be removed later during synchronization.

      Parameters

      Returns void

    • Releases a view fragment, making it available for reuse.

      Parameters

      Returns void

    • Synchronizes and removes any views that were previously marked for removal.

      Returns void