Our blazing fast Grid component built with pure JavaScript


Post by henrique »

I have a situation on my system, where I add a grid inside a div, and this div is attached after the grid created.

The grid data is not loaded, I put an example below.

import '../_shared/shared.js'; // not required, our example styling etc.
import Grid from '../../lib/Grid/view/Grid.js';
import '../../lib/Grid/column/NumberColumn.js';
import DataGenerator from '../../lib/Core/helper/util/DataGenerator.js';

let mydiv = document.createElement('div');

new Grid({

appendTo : mydiv,
columns : [
    {
        text   : 'Name',
        field  : 'name',
        flex   : 2,
      }, {
        text  : 'Age',
        field : 'age',
        width : 100,
        type  : 'number'
    }, {
        text  : 'City',
        field : 'city',
        flex  : 1
    }
],
data : DataGenerator.generateData(50)
});

document.getElementById('container').append(mydiv);

Post by mats »

Confirmed, we'll look into it: https://github.com/bryntum/support/issues/3485


Post by mats »

Try calling triggerPaint after adding to the DOM:

grid.triggerPaint();

as a workaround for now.


Post by henrique »

It's worked! Thanks!


Post Reply