bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

Make `lazyLoadShowLoadingIndicator` configurable #9989

Open ghulamghousdev opened 2 weeks ago

ghulamghousdev commented 2 weeks ago

Forum post

Hi, I started using crud manager using async lazy loaded event store. Ever since I am seeing some green loading indicator and I can't seem to get rid of it. I'll attach the video below, any help is appreciated, thanks.

Here's my event store config:

export class CalendarReservationsStore extends EventStore {
  static configurable = {
    modelClass: ReservationModel,
    syncDataOnLoad: true,
    lazyLoad: {
      bufferUnit: 'day',
      bufferAmount: 30
    }
  }

  async requestData({
    startDate,
    endDate
  }: {
    startDate: Date
    endDate: Date
    startIndex: number
    count: number
  }): Promise<{ data: ReservationModel[] }> {
    const response = await calendarReservationsStore.forceLoad(
      calendarsStore.getCalendarId(),
      dayjs(startDate),
      dayjs(endDate)
    )

return {
  data: response as ReservationModel[]
}
  }

  async reload(startDate: Date, endDate: Date): Promise<void> {
    const { data } = await this.requestData({
      startDate,
      endDate,
      startIndex: 0,
      count: 0
    })

await this.loadDataAsync(data)
  }
}