【问题标题】:Why is sap.ui.table.TreeTable showing phantom rows (improper data rendering)?为什么 sap.ui.table.TreeTable 显示幻行(数据渲染不正确)?
【发布时间】:2014-10-26 16:00:11
【问题描述】:

我已经在这里http://jsbin.com/pakututana/1/edit发布了问题的重构。

数据应导致 TreeTable 中的 2 级深度节点的呈现。但相反,有一个幻影行把它弄得乱七八糟。

有什么想法吗?

谢谢

【问题讨论】:

    标签: sapui5 treetable


    【解决方案1】:

    我看到了您发布的链接。您创建的 JSON 不适用于 TreeTable 让我指出您在代码中犯的一些错误。

    检查要点:

    1. var tData = {"SessionTransactions":{}} //This is not required its unnecessarily declared  
    
         //   Use this directly
        var tData = { 
                "":{},
                "SessionTransactions":{//Some Value}
         };
    
    2. tData = {
            "": {},
            "SessionTransactions": {
                0: {
                    0: {},
                    1: {},
                    2: {},
                    3: {},
                    4 :{   //This was missing which leads to the empty row
                       "__metadata": {},
                       "Service": {},
                       "Poi": {}
                    }
                },
                1: {
                  0:{}
                }
              }
        };
    3. The second level child with empty rows is because of "__metadata","Service" and "Poi"
          0:{
            "__metadata": {},
            "Service": {},
            "Poi": {}
          }
    

    更改 json 后立即尝试。我认为它可以帮助你

    【讨论】:

    • 如果解决方案解决了您的问题,您可以接受答案(通过选择绿色勾号),或者如果您有其他问题,您也可以提出问题。 :)
    【解决方案2】:

    下次使用搜索,要清除 .__metadata = ""; - 财产...

    SAPUI5 create JSON for TreeTable / empty rows

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-28
      • 2018-04-14
      • 1970-01-01
      • 2014-01-23
      • 2021-08-06
      • 1970-01-01
      相关资源
      最近更新 更多