Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Const loadAllAssociationOptions

  • loadAllAssociationOptions(entityProperties: MetaPropertyInfo[], entityName: string, getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue, opts?: DataCollectionOptions): Map<string, undefined | DataCollectionStore<Partial<WithId & SerializedEntityProps>>>
  • Invokes Generic REST API to retrieve the lists of possible options for each Association attribute of a given entity (possible options meaning entity instances that can be used as a value of that attribute). Requests will be sent only for the attributes that the user is permitted to read. Returns a Map where keys are associated entity names and values are DataCollectionStore instances (see CUBA React Core API Reference) or undefined if the user doesn't have a permission to read the attribute. The map is returned immediately, but each DataCollectionStore will only contain the retrieved options once the corresponding request to Generic REST API is complete. Upon successfull request, a DataCollectionStore will contain the retrieved options as its items property (MobX observable).

    Parameters

    • entityProperties: MetaPropertyInfo[]

      entity properties metadata

    • entityName: string
    • getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue

      function returning user's permission for a given entity attribute

        • (entityName: string, attributeName: string): EntityAttrPermissionValue
        • Parameters

          • entityName: string
          • attributeName: string

          Returns EntityAttrPermissionValue

    • Optional opts: DataCollectionOptions

      DataCollectionStore configuration options

    Returns Map<string, undefined | DataCollectionStore<Partial<WithId & SerializedEntityProps>>>

    a Map where keys are associated entity names and values are DataCollectionStore instances that will (once the requests to Generic REST API are complete) contain the retrieved options as their items property (MobX observable). If the user doesn't have a permission to read some of the attributes, the corresponding values will contain undefined.

Const loadAssociationOptions

  • loadAssociationOptions<E>(parentEntityName: string, attributeName: string, nestedEntityName: string, getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue, opts?: DataCollectionOptions): undefined | DataCollectionStore<E>
  • Invokes Generic REST API to retrieve the possible options for an Association attribute (i.e. entity instances that can be used as a value of that attribute). The request will be sent only if the user has a permission to read that attribute. Returns a DataCollectionStore instance (see CUBA React Core API Reference) or undefined if the user doesn't have a permission to read the attribute. The instance is returned immediately, but it will only contain the retrieved options once the request to Generic REST API is complete. The instance will contain the retrieved options as its items property (MobX observable).

    Type parameters

    • E

    Parameters

    • parentEntityName: string

      name of the entity containing an Association attribute

    • attributeName: string

      name of the Association attribute

    • nestedEntityName: string

      name of the entity contained in the Association attribute

    • getAttributePermission: (entityName: string, attributeName: string) => EntityAttrPermissionValue

      function returning user's permission for a given entity attribute

        • (entityName: string, attributeName: string): EntityAttrPermissionValue
        • Parameters

          • entityName: string
          • attributeName: string

          Returns EntityAttrPermissionValue

    • opts: DataCollectionOptions = ...

      DataCollectionStore configuration options

    Returns undefined | DataCollectionStore<E>

    a DataCollectionStore instance that will (once the request to Generic REST API is complete) contain the retrieved options as its items property (MobX observable). If the user doesn't have a permission to read the attribute, an undefined will be returned instead.

Generated using TypeDoc