簡體   English   中英

Ag-Grid 行組呈現錯誤

[英]Ag-Grid row groups rendering bug

我只是根據某些值對行進行分組。 這是我的數據庫結構的簡化版本:

  • 物品
    • ID
    • 父 ID(如果這是子項)
    • 項目類型(父、子、普通)

當行的項目類型為父項時,我正在分組。 我為該行的子項執行數據庫提取,並將它們填充到行組中。

我最終遇到了一個非常奇怪的渲染問題:(GIF) https://imgur.com/a/8lFVjLn

這是我的代碼。 它是 CoffeeScript,但對於那些熟悉 JS 的人來說應該是不言自明的。 “?” 只是一個空檢查,“@”是“這個”

....
          # 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的數據庫調用。

不幸的是,我無法使用 Ag Grid 的行分組。 在我開發這個功能的整個過程中,感覺就像我在與網格搏斗並試圖讓它做一些它不應該做的事情。 謝天謝地,我遇到了主/詳細文檔,並將改為走這條路。 到目前為止,它完全適用於我所需要的(服務器端數據和僅擴展某些行的組)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM