Ag-Grid行组渲染错误

问题描述 投票:0回答:1

我只是将特定值的行分组。这是我的数据库结构的简化版本:

  • 项目
    • id
    • 父ID(如果这是子项)
    • 项目类型(父母,孩子,普通)

我在该行的项目类型为父项时进行分组。我为该行的子级执行数据库提取,并将其填充到行组中。

我最终遇到了一个非常奇怪的渲染问题:(GIF)https://imgur.com/a/8lFVjLn

这是我的代码。它是CoffeeScript,但对于那些熟悉JS的人应该不言自明。 “?”只是一个空检查,“ @”是“ this”

....
          # the user has expanded a group, so check that we have parent node data...
          else if params.parentNode? and params.parentNode.data? and params.parentNode.expanded
            parentId = params.parentNode.data.id

            if @editionsDict[parentId]?
              params.successCallback(@editionsDict[parentId], @editionsDict[parentId].length)
            else
              # database call that returns a promise for when data is retrieved
              @gridLoadChildren(parentId).then((res) =>
                setTimeout(()=>
                  @editionsDict[parentId] = @childWorks
                  params.successCallback(@editionsDict[parentId], @editionsDict[parentId].length)
                ,0)
              )

@childWorks填充在@gridLoadChildren中。除此之外,@gridLoadChildren只是一个使用父ID执行select的数据库调用。

javascript coffeescript ag-grid
1个回答
0
投票

[我发现我的代码实际上没有任何问题(感谢),但是这与Ag-Grid的材质主题有关。我已经切换到Balham,问题就消失了。

© www.soinside.com 2019 - 2024. All rights reserved.