How to use the @bentley/presentation-components.ContentDataProvider function in @bentley/presentation-components

To help you get started, we’ve selected a few @bentley/presentation-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imodeljs / imodeljs / presentation / testing / src / ContentBuilder.ts View on Github external
private async doCreateContent(rulesetId: string, instanceKeys: InstanceKey[], displayType: string): Promise {
    const dataProvider = this._dataProvider ? this._dataProvider : new ContentDataProvider(this._iModel, rulesetId, displayType);
    dataProvider.keys = new KeySet(instanceKeys);

    const content = await dataProvider.getContent();
    if (!content)
      return [];

    const records: PropertyRecord[] = [];

    const sortedFields = content.descriptor.fields.sort((f1, f2) => {
      if (f1.name > f2.name)
        return -1;
      if (f1.name < f2.name)
        return 1;
      return 0;
    });