Dhtmlx foreachRow 不起作用

Dhtmlx foreachRow does not work

我有这段代码,但是在 foreachRow 函数内部没有任何反应:

SYSTEM.Grid.load(urlLoad);


 SYSTEM.Grid.forEachRow(function(id){
    console.log("teste");
}

有解决这个问题的想法吗?

函数"SYSTEM.Grid.load(urlLoad);" 异步运行,因此您需要使用回调来放置 foreachRow 函数。这样它只有在整个网格加载后才能正确执行其功能:

SYSTEM.Grid.load(urlLoad, function(){
    SYSTEM.Grid.forEachRow(function(id){
        console.log("teste");
    }
});