How to use the GanttCrudManager?

Our state of the art Gantt chart
User avatar
bjork
Posts: 20
Joined: Mon Apr 08, 2019 2:47 pm

How to use the GanttCrudManager?

Post by bjork » Thu Aug 15, 2019 1:42 pm

Hello!

I'm wondering how I initialize the ganttcrudmanager? I can't even seem to find the class under the Bryntum namespace.. A guide of how to work with the ganttcrudmanager would be very helpful..

(I'm using ExtJs modern and BOTH scheduler and gantt components)

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

Re: How to use the GanttCrudManager?

Post by pmiklashevich » Thu Aug 15, 2019 2:43 pm

Hello,

Please see the guides here:
https://www.bryntum.com/docs/gantt/#guides/project_data.md
https://www.bryntum.com/docs/gantt/#guides/crud_manager.md

You can also refer to our demos, for example PHP demo shows how to work with data.

If you have some more specific questions, feel free to create a thread and we will try to help you asap

Cheers,
Pavel
Pavel Miklashevich - Core Developer

User avatar
bjork
Posts: 20
Joined: Mon Apr 08, 2019 2:47 pm

Re: How to use the GanttCrudManager?

Post by bjork » Fri Aug 16, 2019 3:11 pm

Thank you. I've gotten pretty much everything to work with crud but I'm still having some troubles configuring the fetchOptions. How would you edit the php-demo to change the fetchOptions (specifically the credentials part)? Can it be done on the transport object itself or do you have to access each individual store and change it there? If you could give an example with the php-demo as base that would be very helpful.

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

Re: How to use the GanttCrudManager?

Post by pmiklashevich » Fri Aug 16, 2019 4:13 pm

It's not supported at the moment. Ticket here: https://app.assembla.com/spaces/bryntum/tickets/9067-crud-manager-should-support-fetchoptions/details
Thanks for the report!

When ticket is done it should be possible to configure transport like:

Code: Select all

    transport      : {
        load : {
            requestConfig : {
                fetchOptions : {
                    credentials: 'include'
                }
            },
            url : 'php/load.php'
        }
    },
Pavel Miklashevich - Core Developer

User avatar
bjork
Posts: 20
Joined: Mon Apr 08, 2019 2:47 pm

Re: How to use the GanttCrudManager?

Post by bjork » Mon Aug 26, 2019 1:36 pm

Will this be in the next Gantt release?

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

Re: How to use the GanttCrudManager?

Post by pmiklashevich » Tue Aug 27, 2019 10:28 am

It's going to be available in a nightly build later this week. Stay tuned!
Pavel Miklashevich - Core Developer

User avatar
bjork
Posts: 20
Joined: Mon Apr 08, 2019 2:47 pm

Re: How to use the GanttCrudManager?

Post by bjork » Wed Sep 11, 2019 2:26 pm

Is it available in the Gantt 1.1.5? I see that it is added in the scheduler 2.2.4 but am specifically wondering about the Gantt..

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

Re: How to use the GanttCrudManager?

Post by pmiklashevich » Wed Sep 11, 2019 8:35 pm

Sure, Scheduler.data.CrudManager implements Scheduler.crud.transport.AjaxTransport abstract class, please see https://www.bryntum.com/docs/gantt/#Scheduler/data/CrudManager#config-transport
So yes, it's available in Gantt now. To use it please set up requestConfig for load/sync as shown on the code snippet above.
Pavel Miklashevich - Core Developer

User avatar
bjork
Posts: 20
Joined: Mon Apr 08, 2019 2:47 pm

Re: How to use the GanttCrudManager?

Post by bjork » Thu Sep 12, 2019 9:46 am

Ok, I think I found the issue (a misspelled key). In your class AjaxHelper the following lines of code can be found:

Code: Select all

    static fetch(url, options = {}) {
        const
            controller = new AbortController();
        options.signal = controller.signal;

        if (!('credentitals' in options)) {
            options.credentials = 'include';
        }
Since 'credentitals' is never found in the object the last thing the fetch-option does is to add credentials:include on the request. Took me good while to find this bug :)

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

Re: How to use the GanttCrudManager?

Post by mats » Thu Sep 12, 2019 10:53 am

Sorry for that typo, I've corrected it now:

Code: Select all

if (!('credentitiaiaiiaiaitals' in options)) {

}
😄
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

Post Reply