Is it possible to create the following matrix with scheduler or grid?

Show cool things you have done with our products
Post Reply
User avatar
KAB
Posts: 13
Joined: Fri Jan 18, 2019 4:52 pm

Is it possible to create the following matrix with scheduler or grid?

Post by KAB » Thu Jul 25, 2019 4:18 pm

Hi Everyone

Is it possible to create the following grid with bryntum tools:
If yes, are there any examples available?

Thank you!
Attachments
selection_305.png
selection_305.png (183.98 KiB) Viewed 385 times

User avatar
mats
Core Developer
Core Developer
Posts: 14593
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: Is it possible to create the following matrix with scheduler or grid?

Post by mats » Thu Jul 25, 2019 11:54 pm

Absolutely, that would be very easy! It's just a grid with a number of columns and an editable row. Have you tried our demos and downloaded our trial?

Also study our docs to learn how to enable editing and use other grid features: https://bryntum.com/docs/grid
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
KAB
Posts: 13
Joined: Fri Jan 18, 2019 4:52 pm

Re: Is it possible to create the following matrix with scheduler or grid?

Post by KAB » Fri Jul 26, 2019 10:50 am

Hi mats. Thanks for your reply. I have not found an an example of a grid with dynamic columns. Is that possible?
Because I have a start and end date and I want to create a column for every day between those dates. The dates can also be changed and the widget should refresh itself and update it's columns.

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2254
Joined: Fri Apr 01, 2016 11:08 am

Re: Is it possible to create the following matrix with scheduler or grid?

Post by pmiklashevich » Fri Jul 26, 2019 11:47 am

grid.columns is a store. So adding new records or changing existing data will reflect to the grid immediately.

https://bryntum.com/examples/grid/manycolumns/ demo shows how to generate columns dynamically.

https://bryntum.com/examples/grid/columns/ demo shows how to add/remove columns dynamically.

https://www.bryntum.com/examples/grid/multiregion/ demo shows how to configure different subgrids.

https://www.bryntum.com/examples/grid/summary/
https://www.bryntum.com/examples/grid/multisummary/
demos show how to calculate summary

So in your case it's left to implement column generation based on the time range. We don't have ready-to-use solution., so you'll have to implement it by yourself. Please check out the demos I've mentioned above and all the other demos we have for inspiration.

If you get stuck with something feel free to ask on the forums (one thread per question, see how to ask for help here). If you need complex help in implementation, we provide Professional Services. If you're interested please contact us here: https://www.bryntum.com/contact/

Best,
Pavel
Pavel Miklashevich - Core Developer

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2254
Joined: Fri Apr 01, 2016 11:08 am

Re: Is it possible to create the following matrix with scheduler or grid?

Post by pmiklashevich » Fri Jul 26, 2019 12:21 pm

Just to help you to get started here is how you can generate your columns:

Code: Select all

const generateDateColumns = (start, end) => {
    let columns = [],
        dt      = DateHelper.clone(start);

    if (dt.getTime() >= end.getTime()) return columns;

    while (dt.getTime() < end.getTime()) {
        columns.push({
            field  : DateHelper.format(dt, 'YYYY-MM-DD'), // need to match data field
            text   : DateHelper.format(dt, 'dd DD'),
            flex   : 1,
            region : 'normal'
        });

        dt = DateHelper.add(dt, increment, unit);
    }

    return columns;
};
Please replace examples/manycolumns/app.js with the one from archive and try how it works:
app.js.zip
(1006 Bytes) Downloaded 52 times
Pavel Miklashevich - Core Developer

Post Reply