Data Source Toolbar Filter

Hi, what has changed in the new 'v92" branch on GitHub. The filter we set did work before but now it doesn't work anymore. We only want to show the directs when the view is initial loaded (don't have to set filter manually).

Do I have to change something in the code. This is our code:

private async init(): Promise<void> {

    this.filterOptions = [
      {
        Description: await this.translate.get('#LDS#Status').toPromise(),
        Name: 'OnlyDirect',
        Delimiter: ',',
        Options: [
          {
            Value: "true",
            Display: await this.translate.get('#LDS#Directly assigned').toPromise(),
          },
        ],
        Column: 'OnlyDirect',
      },
    ];
    const OnlyDirect = this.filterOptions.findIndex((elem) => elem.Name === 'OnlyDirect');
    this.filterOptions[OnlyDirect].InitialValue = 'true';
  }
Parents Reply
  • My work-around until fixed:

    projects\qbm\src\lib\data-source-toolbar\data-source-toolbar.component.ts

    added reset parameter on applyConfig()

    public applyConfig(config: DSTViewConfig, resetView:boolean = true): void {
    // Clear all old data, but don't emit any signals
    if (resetView) {
    this.resetView(false);
    this.clearTreeFilter(false);
    }

    prevent reset on applyConfig() call from setInitialFilterValues()

    // Here we prefer the saved default config over emiting the init
    this.settings.filters?.forEach((filter) => {
    const initialValue = filter.InitialValue;
    if (initialValue) {
    filter.CurrentValue = initialValue;
    const option = this.findFilterOptionFromValue(initialValue, filter);
    if (option) {
    this.selectedFilters.push({ selectedOption: option, filter });
    }
    }
    });
    
    this.applyConfig(this.settings?.viewConfig?.viewConfigs?.find((config) => this.isDefaultId(config)), false);
    }

Children
No Data