Premium support for our pure JavaScript UI components


Post by EarlyHost »

I used the example for filtering and highlighting of events.
If i attach the b-mark class to the events, crudManager triggers a sync, wich fails, because of server logic.

For me, it looks like a bug in scheduler 5.0.1. change of cls shouldn´t persisted.

The attached testcase logs the syncing.

Attachments
sync_when_highlight.zip
Testcase based on filtering demo
(1.78 KiB) Downloaded 29 times

Post by tasnim »

I'm not able to run this because of errors. Could you please provide the whole app?


Post by EarlyHost »

This is the whole test case.
We include bryntum with script tag. So you should change the paths for the scheduler.umd.js and css to load scheduler.
BTW: Wich errors occure? I run the file in Edge and everything was fine.


Post by tasnim »

It's not a bug. The field persists its change to the server and this is by design. If you just want to highlight certain events you can use the eventRenderer function and for cells renderer function.

Please check these :
https://bryntum.com/docs/scheduler/api/Scheduler/view/Scheduler#config-eventRenderer
https://bryntum.com/docs/scheduler/api/Grid/column/Column#config-renderer


Post by EarlyHost »

So your example is wrong?


Post by arcady »

Which example is wrong?


Post by EarlyHost »

https://www.bryntum.com/examples/scheduler/filtering/

This was the base for my testcase. I extend crudManager for syncing and log syncs.
If i set the cls property crudManger syncs...


Post by arcady »

Well the demo does what it's meant to do ..changes the event cls field values which makes the records dirty.
The approach it shows just doesn't fit your requirements as far as I see.

If you need another logic just use another options the API suggests:
1) make cls field not persisted to the server at all

class MyEvent extends EventModel {

    static get fields() {
        return [
           { name: 'cls', persist : false }
        ];
    }

});

2) or add some other not persisted field to store record extra CSS classes

class MyEvent extends EventModel {

    static get fields() {
        return [
           { name: 'extraCls', persist : false }
        ];
    }

});

and then use eventRenderer to use CSS from that field

 eventRenderer({ eventRecord, resourceRecord, renderData }) {
     renderData.cls += ' extra-class';
 }

Post by EarlyHost »

I don´t want to render all tagged events again and again.
cls is a DOMClassList, so nothing in that property should persistet, because its only markup no data.
So i try to add persist:false to my model and hope this stops triggering sync.

Main problem i think is, that i had to change the model / data of that event. For hilighting i think setting a class to the HTML-Element is a better approach. Could i access that element?


Post by alex.l »

I don´t want to render all tagged events again and again.

This is how it works. Event elements reflect record data change and will be refreshed accordingly. Not all, but only required items.
You can get element by event record using this method: https://bryntum.com/docs/scheduler/api/Scheduler/view/mixin/SchedulerDom#function-getElementFromEventRecord

All the best,
Alex


Post Reply