Our pure JavaScript Scheduler component


Post by udo »

hi,

I have a combobox in the toolbar
Image

which is configured in app.config.ts like this:

  ...
  tbar: {
    items: {
      cboGroups: {
        type: 'combo',
        // ToDo: set to last selected value
        value: 0,
        items: JSON.parse(localStorage.getItem('groups')),
        valueField: 'id',
        displayField: 'name',
        listeners: {
          change: (event) => {
            const scheduler = event.source.parent.parent;
            // ToDo: how to trigger CrudManager.load (to pass event.value)
          }
        },
      },
      ...
  },
  ...
}

how can I trigger CrudManager.load() and pass event.value as query string param (so the data in the scheduler is refreshed)?

note: in app.component.ts I have CrudManager configured like this:

    // source: https://bryntum.com/products/scheduler/docs/api/Scheduler/data/CrudManager#ajax-request-configuration
    const crudManager = new CrudManager({
      autoLoad: true,
      autoSync: true,
      resourceStore,
      eventStore,
      assignmentStore,
      transport: {
        load: {
          url: '.../CmLoadOrders',
        },
        sync: {
          url: '.../CmSyncOrders',
        }
      }
    });

thanks, udo


Post by tasnim »

Hello Udo,

Here is an example of how you could achieve it

scheduler.crudManager.load({ request : { params : { value : 'value' } } })

Docs
https://bryntum.com/products/scheduler/docs/api/Scheduler/data/CrudManager#function-load


Post by udo »

thank you tasnim.

unfortunately doing as you suggest

        ...
        listeners: {
          change: (event) => {
            const scheduler = event.source.parent.parent;
            scheduler.crudManager.load({ request : { params : { value : event.value } } });
          }
        },
        ...

is generating error Cannot read properties of undefined (reading 'load')

console logging scheduler -> console.log(scheduler), I can't find an attribute/method crudManager (which explains the error).

am I missing something?


Post by tasnim »

Hey udo,

This is unexpected. Could you please upload your app here or a test case so we can repro this and debug it?


Post by udo »

sorry tasnim. I'm not allowed to share the project.

do you guys (bryntum) have a base scheduler github repo which I could fork and branch from there to reproduce the issue?

note: as an alterative I could provide you single files of the project (but not uploaded to this forum).

btw. I'm on version 5.2.8


Post by marcio »

Hey udo,

You can get one of our demos that are available in the Bryntum suite source code that your company has the license to (or get the code of one of our online demos) and then adapt it to your needs.

You can also share it files to support[at]bryntum.com :)

Best regards,
Márcio


Post by udo »

thank you marcio. e-mail is out (on the way) :)


Post by udo »

I identified the issue. it's the way I am using the CrudManager in app.component.ts :|

I am now seeing exactly what tasnim expected me to see in his answer -> viewtopic.php?p=117261#p117261

configuring the CrudManager in app.config.ts resolves my issue.

apologies for this and thank you for your support. highly appreciated! issue closed.


Post Reply