Premium support for our pure JavaScript UI components


Post by takafumi ohtake »

Hi,

I use Core.data.Model#toJSON.
However, when I add fields with Core.data.Model#addField, the added field values is absent in the returned json.

Is there a way to include the added field in json?

CustomTaskModel.addField({
   name: 'custom_1',
   type: 'string',
});

record['custom_1'] = 'test';
console.log(record['custom_1']); // output: 'test'
console.log(record.toJSON()); // custom_1 is absent


Post by takafumi ohtake »

In addition, I found another issue.
When I add a aggregate type column dynamically, parent rows doesn't refresh automatically.
It can be reproduced with the demo https://bryntum.com/examples/gantt/aggregation-column/ using the code below.

aggregate_column.mp4
(379.88 KiB) Downloaded 9 times
gantt.project.taskModelClass.addField({name: 'custom_2', type: 'number'});
gantt.columns.add({id: 'custom_2', field: 'custom_2', text: 'Budget', type: 'aggregate'})

Post by alex.l »

Thank you for the report. Fields which dynamically added to Model class will be available only for new created instances and won't be catch by already created records. That causes both problems you reported. I've opened a ticket to fix this moment. https://github.com/bryntum/support/issues/5008

All the best,
Alex


Post Reply