Premium support for our pure JavaScript UI components


Post by cedenojustin »

We are just trying to use the groupings and locking row feature in the scheduler, but for some reason, the display is not as we expected. The locking rows feels like cloning the whole content of the grid and not rendered correctly. Can someone help me with this. Thank you!

Sample code of the implementation:

<Bryntum
    ...
    groupFeature={{
        field: `virtualUserType`,
        ascending: false,
        }}
    lockRowsFeature={{
        fieldName: 'fixed'
        }}
    ...
/>
Attachments
22.07.2024_07.55.18_REC.mp4
(2.71 MiB) Downloaded 20 times

Post by ghulam.ghous »

Hi there,

I have tried to replicate the issue but was not able to do so. I have checked it on https://bryntum.com/products/scheduler/examples/lock-rows/. Attaching a clip to show the behaviour. Can you please check it and let us know if I missed something?

LockRows.zip
(5.22 MiB) Downloaded 18 times

Also which version of bryntum you are using?

Regards,
Ghous


Post by cedenojustin »

Hi Ghulam,

We have already seen the given example and applied it to our project, but it is still not working. Can you possibly write a sample code using the React version of the scheduler that implements groupings and locks rows together? Thank you!
As for a reference this is how we import all of the Bryntum scheduler packages for our react project.

export {
  BryntumScheduler,
  BryntumGrid,
  BryntumSplitter,
  BryntumCombo,
  BryntumTimeField,
  BryntumDateField,
  BryntumDateTimeField,
  BryntumTextField,
  BryntumResourceCombo,
  BryntumNumberField,
  BryntumTextAreaField
} from '@bryntum/scheduler-react';

Post by ghulam.ghous »

Hi there,

I have assembled an demo in React. Please check it out and let me know if you need further assistance.

advanced.zip
(3.61 MiB) Downloaded 19 times

Regards,
Ghous


Post by cedenojustin »

Hi Ghulam,

Indeed, locking rows works with the groupings in the example provided. However, upon checking, this does not work well with data that needs to be fetched via api and inserted into the store using the .add method. If possible, could you provide an example of how to implement it?


Post by ghulam.ghous »

If I understand correctly, you are not using our api's to load data. If yes, then I am not sure which method you are using to load data into store. But the recommended way of doing that is using loadInlineData method https://bryntum.com/products/scheduler/docs/api/Scheduler/model/mixin/ProjectModelMixin#function-loadInlineData. Can you please try with this? If this does not work, can you share a small sample project with us? You can use the above example and add your bits of code into it.


Post by cedenojustin »

Hi Ghulam,

Can't really share the exact code of the implimintation but this is how we add data to the store

<BryntumScheduler ref={scheduler} />

const addToSchedulerStore = ({ storeName, data }: IAddToStore) => {
    if (scheduler?.current !== undefined) {
      const { schedulerInstance } = scheduler.current;

      return schedulerInstance.resourceStore.add(data);
    }
  };

As you can see we access the scheduler instance and add data to the resourceStore using the add function.


Post by ghulam.ghous »

Hi there,

I believe you will have to remove the records from the store as well, if there are any. But I have tried testing the feature with loading data using loadingInlineData and it works without any issues. We recommend using this method instead of add on the individual stores. Please check the clip and test app:

advanced 2.zip
(3.64 MiB) Downloaded 16 times

https://drive.google.com/drive/folders/1g23vFtcV-NsZ6TQgj89WhU_B81-lF-iM?usp=sharing


Post by cedenojustin »

Hi Ghulam,

I think it will only work if the data are already completed. But on our case we loaded thousands of data and we process it by batch. That is why on our code, we used the .add method because it will just add the upcoming data from the old data in the scheduler. But on your example where having an issue implementing it. Thank yoU!

const addToSchedulerStore = ({ storeName, data }: IAddToStore) => {
    if (scheduler?.current !== undefined) {
      const { schedulerInstance } = scheduler.current;

      return schedulerInstance.resourceStore.add(data);
    }
  };

Post by ghulam.ghous »

Alright, I can understand your usecase. Lock rows should be working with that too and if it is not, it might be a bug on our side. We really need a test case to debug this. Please share one.


Post Reply