Our pure JavaScript Scheduler component


Post by Luffy »

https://app.box.com/s/sfpe120wiyoeziipo25t4aqr0fdqd9xj

can this filter and highlight feature be done across multiple schedulers?

Post by mats »

Sure, the things you see in the demo headers are just demo code so just read the source files and adapt them to your needs :)

Post by Luffy »

so just read the source files and adapt them to your needs :)
Source file means the file that in the licensed version or somewhere else. because i am working in react section. cannot find this demo in there. :(

Post by pmiklashevich »

Hello,

"Source file" means demo code which does filtering and highlighting. Yes, you're right, there is no filtering demo in react section. But still it should be doable to learn out of 2 demos. If you look at examples/simple demo you'll find how to add a widget in the header in react. The only difference is that handler must be different. Now please look at examples/filtering.
placeholder          : 'Find tasks by name',
onChange             : ({ value }) => {
    value = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');

    scheduler.eventStore.filter(event => event.name.match(new RegExp(value, 'i')));
}
If you analyze what's happening here, you'll see that store.filter API method is called. If you want to filter through all the schedulers on the page, you need to collect all the stores used and filter them all.
placeholder          : 'Highlight tasks',
onChange             : ({ value }) => {
    scheduler.eventStore.forEach(task => {
        const taskClassList = new DomClassList(task.cls),
            matched = taskClassList['b-match'];

        if (task.name.toLowerCase().indexOf(value) >= 0) {
            if (!matched) {
                taskClassList.add('b-match');
            }
        }
        else if (matched) {
            taskClassList.remove('b-match');
        }
        task.cls = taskClassList.value;
    });
    scheduler.element.classList[value.length > 0 ? 'add' : 'remove']('b-highlighting');
}
Same here. This part of code shows how to highlight tasks in one scheduler. So it's left to collect all schedulers and stores and apply the same approach.

Good luck,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by Luffy »

Thanks Pavel. Finally it worked. :)
https://app.box.com/s/hkrwg9docfeyvxmuhgeg45zdkum7edpd



I want to know are these widgets completely free when we purchase the bryntum license. or do we need to pay for these widgets additionally ?

And what if we want to create our own widgets. Is it possible..?

Post by mats »

 I want to know are these widgets completely free when we purchase the bryntum license. or do we need to pay for these widgets additionally ?
They are part of your purchase yes.
 And what if we want to create our own widgets. Is it possible..?
You can create your own too yes, just look at the ones included and it should be straight forward.

Post by pmiklashevich »

Thanks Pavel. Finally it worked. :)
Great!

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply