In some cases we reload the entire gantt schedulers data (clear all, add new resources, new tasks)
When the scrollbar is somewhere in the lower middle, the schedulers screen remains white although at this position gantt data are available when all html elements are rendered.
the loading of the tasks begins only when we scroll upwards. (It looks like that the lazy rendering begins to render the html-elements)
Is there a way that we can say, when the gantt data is reloaded that the rendering is executed until the position of the vertical scroll bar?
Our desired behavior is, when the number of resources not change that the vertical position does not change after reloading. E.g. the user remains on the same vertical position after reloading.
Should be working ok, how can we reproduce that? What version you use?
Any chance to get a runnable test case to reproduce it and check your full configs?
Sorry, your code doesn't work. There is no initial data, and createEvents method adds only resources in fact, but I guess you know that. Gate class in never used. After I fixed all and applied createEvents to our tree example, I am not able to reproduce the problem.
Could you please try to edit our tree demo (check "examples/tree" folder in sources you downloaded) to make this problem reproducible?
Sorry, your code doesn't work. There is no initial data, and createEvents method adds only resources in fact, but I guess you know that. Gate class in never used. After I fixed all and applied createEvents to our tree example, I am not able to reproduce the problem.
Could you please try to edit our tree demo (check "examples/tree" folder in sources you downloaded) to make this problem reproducible?
Thank you!
Hello Alex
Yes, this is just a reproducing sample. (I know that I only add Resources and no events, I agree: the function name is not very well choosen.)
We don't need the Crud-Manager or Inital-Data from a webserver. Our Inital-Data is set with Javascript Methods (the scheduler is embedded in the Dynamics Nav 365 ERP (https://dynamics.microsoft.com/en-us/); That means in our case: The Inital-Data can only be set with JavaScript Methods.
Is it mandatory to use a Gate Class when the Data is only set with JavaScript Methods?
Ok, i just modified the tree example (commented out the crud loading, added createEvents Method). the issue with the white screen remains: scroll to the middle and run createEvents again.
'use strict';
var {
Scheduler,
ResourceModel,
StringHelper
} = bryntum.scheduler; //TODO: tree filtering
class Gate extends ResourceModel {
static get fields() {
return [{
name : 'capacity',
type : 'number'
}];
}
}
Gate.exposeProperties();
var scheduler = new Scheduler({
appendTo : 'container',
eventColor : null,
eventStyle : null,
features : {
timeRanges : {
showHeaderElements : false
},
tree : true,
regionResize : true
},
rowHeight : 45,
barMargin : 5,
columns : [{
type : 'tree',
text : 'Name',
width : 220,
field : 'name'
}, {
type : 'aggregate',
text : 'Capacity',
width : 90,
field : 'capacity'
}],
startDate : new Date(2017, 11, 2, 8),
//endDate : new Date(2017, 11, 3),
viewPreset : 'hourAndDay',
// crudManager : {
// autoLoad : true,
// resourceStore : {
// modelClass : Gate
// },
// transport : {
// load : {
// url : 'data/data.json'
// }
// },
// // This config enables response validation and dumping of found errors to the browser console.
// // It's meant to be used as a development stage helper only so please set it to false for production systems.
// validateResponse : true
// },
eventRenderer({
eventRecord,
resourceRecord,
renderData
}) {
var {
isLeaf
} = resourceRecord; // Custom icon
renderData.iconCls = 'b-fa b-fa-plane'; // Add custom CSS classes to the template element data by setting property names
renderData.cls.leaf = isLeaf;
renderData.cls.group = !isLeaf;
return isLeaf ? StringHelper.encodeHtml(eventRecord.name) : '\xa0';
}
});
createEvents();
function createEvents()
{
scheduler.store.clear();
for(let i =0; i < 100; i++)
{
scheduler.store.add({
"id" : "h"+i,
"name" : "Res Id"+i
});
}
}
Is it mandatory to use a Gate Class when the Data is only set with JavaScript Methods?
It's always mandatory to use correct data model independent of how you load data into the store. The UI won't properly react on fields changes which are not specified in data model.