Search code examples
javascriptsapui5treetable

Bug after update TreeTable


I got a problem after updating the a TreeTable, as i understand this is because model is not refreshed, tried to refresh it but it doesnt help. Here is what i see after update: (erased headers by myself) enter image description here

No rows added, but if i scroll horizontally, the rows are added and seen.

Here is my update code:

if (events) {
                tEvents.unbindAggregation("rows");
                tEvents.bindAggregation("rows",{
                    path: "events>/prg_years(ID_SCENARIO=" + filterKRVR.scenario + ",I_YEAR=" + filterKRVR.year + "m)" + "/HisGTO",
                    parameters: {
                        navigation: {
                            'prg_gto':  "HisPIPE",
                            'prg_pipe': "HisKS",
                            'prg_ks':   "HisLK"
                        },
                    }
                }); 
            }
            tEvents.getModel('events').refresh();

What im doing wrong?!

Btw, the bug appers only if im opening in tree table the lowest rows, if i open the heightest rows its ok, no bug.

Thank you all for the help!


Solution

  • i created the new function that scroll the horizontal and vertical scrolls, and refreshed the table after each aggregation or update of rows

    doRefresh: function(){
            $('.sapUiScrollBar div').scrollLeft(100);
            $('.sapUiScrollBar div').scrollLeft(0);
            $('.sapUiScrollBar div').scrollTop(100);
            $('.sapUiScrollBar div').scrollTop(0);
        },
    

    and used it like here: Trigger function after update complete