DHTMLX 网格中缺少行

Rows are missing from DHTMLX Grid

我正在使用 DHTMLX Pro 尝试向 table 添加行。 header 部分加载正常,但 table 中未加载其他行。这是我的代码,

使用 Require.js 包含

'dhtmlxcommon',
'dhtmlxgrid',
'dhtmlxgridcell'

我的渲染函数按如下方式加载网格视图:

render: function(){
    var self = this;
    this.mygrid = new dhtmlXGridObject('grid-layout');
    this.mygrid.setImagePath('../dhtmlx/imgs/');
    this.mygrid.setHeader("ID,Name,Format");
    this.mygrid.setColAlign("center","center","center");
    this.mygrid.setSkin('dhx_skyblue');
    this.mygrid.init();
    data={
        rows:[
            { id:1, data: ["Foo", "Gates", "100"]},
            { id:2, data: ["Bar", "Tom", "1000"]},
            { id:3, data: ["Rain", "Henry", "-200"]}
        ]
    };

    //var newId = (new Date()).valueOf();
    //this.mygrid.addRow(newId,"1,2,3,4,5,6,7,8"); // This does not add a row
    this.mygrid.parse(data,"json"); // This does not add a row either
},

不确定为什么 table 行没有使用 addRowmygrid.parse 添加。

代码看起来正确。检查 'grid-layout' 容器的大小。它必须有一些非零高度,否则网格的数据部分将不会显示。