Our state of the art Gantt chart


Post by mh322 »

Hi Team,

We are planning to migrate from extjs gantt to native-js gantt.

In extjs gantt stores we were using proxy along with readers and writers.
(https://cdn.sencha.com/ext/gpl/4.2.0/docs/#!/api/Ext.data.Store)

But proxy is not available in the new gantt stores.
How to achieve the same functionality in the new version?

Thanks


Post by Animal »

Are you using some custom Proxy to provide data? What's the requirement?


Post by mh322 »

Yes we are using custom proxy, custom readers and custom writers according to the business requirements.

Screenshot 2024-01-18 173005.png
Screenshot 2024-01-18 173005.png (40.19 KiB) Viewed 643 times

As you can see in the screenshot, we want to achieve a similar functionality in the new native-js gantt.


Post by Animal »

That doesn't look like a custom Proxy. It looks like you're just loading from a URL as an AjaxStore does: https://www.bryntum.com/products/grid/docs/api/Core/data/AjaxStore


Post by bksundeepv »

Hi,

In the ExtJS Bryntum Gantt, for custom stores, We have defined our own reader/writers and add them to proxy. Provided below sample code. Can you let us know how to define readers/writers for the store in New Bryntum Gantt? Observe reader and writer section which has custom code.

Ext.define('MyStore', {
    extend: 'Ext.data.Store',
    alias: 'store.MyStore',
    storeId: 'MyStore',
    model: 'MyModel',
    proxy: {
        type: 'MyProxy',
        actionMethods: {
            destroy: 'DELETE',
            update: 'PATCH'
        },
        url: <URL>,
        reader: {
            type: 'ppmjsonreader', -- Custom Reader
            rootProperty: 'items',
            transform: function(data) {
                // Custom logic in reader transform
            }
        },
        writer: {
            type: 'ppmjsonwriter', -- Custom Writer
            writeAllFields: false,
            transform: function(data, request) {
                // Custom logic writer transform
            }
        }
	}
}
Thanks
Sundeep...

Post by Animal »


Post by bksundeepv »

Thanks
Sundeep...

Post by alex.l »

Store has an event where you can transform data before send
https://bryntum.com/products/gantt/docs/api/Core/data/AjaxStore#event-beforeRequest
For the rest, in new Gantt we propagate to use ProjectModel's built-in CrudManager and it has those capabilities
https://bryntum.com/products/gantt/docs/api/SchedulerPro/data/mixin/ProjectCrudManager#event-beforeSend
https://bryntum.com/products/gantt/docs/api/SchedulerPro/data/mixin/ProjectCrudManager#event-beforeResponseApply
For the AjaxStore, I am afraid now we don't have a good place to transform data after load and before apply them, there is a feature request for it that Animal mentioned above.

Full guide about CrudManager is here
https://bryntum.com/products/gantt/docs/guide/Scheduler/data/crud_manager
https://bryntum.com/products/gantt/docs/guide/Gantt/data/crud_manager

All the best,
Alex


Post by bksundeepv »

Hi Alex,

Thanks for the response. This requirement is in custom store(provided example below) which are not part of Crud Manager. Hence apis from Crud manager doesn't work in our case.

Request to check and provide a equivalent apis for below apis. Can you check and provide new feature for supporting these apis in new gantt?

Reader:

https://docs.sencha.com/extjs/7.7.0/modern/Ext.data.reader.Json.html#method-getResponseData
https://docs.sencha.com/extjs/7.7.0/modern/Ext.data.reader.Json.html#cfg-transform

Writer:

https://docs.sencha.com/extjs/7.7.0/modern/Ext.data.writer.Json.html#method-writeRecords
https://docs.sencha.com/extjs/7.7.0/modern/Ext.data.writer.Json.html#cfg-transform

Thanks
Sundeep...

Post by alex.l »

Hi,

As me and Animal mentioned above, the ticket is here New
#8314 AjaxStore JSON encode/decode intervention

All the best,
Alex


Post Reply