Our state of the art Gantt chart


Post by MauriceLapre »

Hi,

I'm implementing my own form of pagination, and want to call .load() on the AssignmentStore for getting the next set of records after I have set the new starting point. It seems the store is cleared first when you call .load(), is that correct? Can that be overridden so the next set of records is just added to the existing records?

Thank you.

Post by pmiklashevich »

Basically pagination is supported. Please see https://www.bryntum.com/docs/gantt/#Core/data/AjaxStore#function-loadPage (see all related properties and configs by searching for 'page' name in the docs). Also we have an example here: https://www.bryntum.com/examples/grid/paged/
'load' method will use 'loadPage' internally if you have 'pageParamName' or 'pageStartParamName' defined.
It seems the store is cleared first when you call .load(), is that correct? Can that be overridden so the next set of records is just added to the existing records?
https://www.bryntum.com/docs/scheduler/#Core/data/AjaxStore#function-load always overrides current data with the new set from server. You can return from server old records + new records. Also you can do a separate ajax call and use store API to add new records to the store:
https://www.bryntum.com/docs/scheduler/#Core/data/AjaxStore#function-add

AssignmentStore is an AjaxStore, so pagination is supported in theory. But to be able to schedule tasks all related stores should contains full data. So having AssignmentStore partially loaded can affect the data you see on the chart and you'll get wrong calculation. Could you please describe your use case. What's your requirements and what exactly you're trying to implement?

Pavlo Miklashevych
Sr. Frontend Developer


Post by MauriceLapre »

Yeah, it's not so much a pagination I'm trying to create actually. More an "infinite scroll" idea, where as the user reaches the bottom, the next x records are fetched. That works for tasks, where I do a separate ajax call and use store.add. I think I will try the same for the assignments, but I just didn't want to duplicate all the logic I apply after fetching but before adding them to the store.

Post by sergey.maltsev »

Hi, MauriceLapre!

If you have working code for tasks then you could try to use it with assignments etc.
As always if you have any further questions please attach sample code here so we could check it and give you an advice.

Post Reply