Search code examples
sapui5treetable

Why is sap.ui.table.TreeTable showing phantom rows (improper data rendering)?


I have posted a reconstruction of the problem here http://jsbin.com/pakututana/1/edit.

The data should lead to a rendering of a 2-level depth nodes in the TreeTable. But instead there a phantom rows cluttering the it.

Any ideas?

Thank you


Solution

  • I Saw the link you posted. The JSON you created is not the valid for the TreeTable Let me point out some of the mistakes you did in your code.

    Check the points:

    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": {}
          }
    

    Try now after changing the json. I think it may help you