Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

358
Views
SAPUI5 Tree Table extension

I am using SAPUI5 sap.ui.table.TreeTable (demo) and would like to change the arrow icon indent and table row background colour for each level of the tree.

What I am trying to achieve - each expanded tree level should have a different shade of grey and the indent of (level * 5px). At the moment the indent increases by 17px.

I would like to know how to achieve it through CSS and through UI5 control extension.

I know that for one a generic table row I could use

tr>td>div>span.sapUiTableTreeIcon {
margin-left:5px !important;
background-color: #F8F8F8;
}

But how to make it dynamic that each level indent will increase by (level * 5) pixels?

Also I would like to achieve the same by extending the UI control, but can't find in the library the exact place that generates the (level * 17px ) indent.

Style screenshot

I had a look at the library file sap.ui.table.TableRenderer-dbg.js and I can see that the icon row gets generated by the following function:

TableRenderer.renderTableCellControl = function(rm, oTable, oCell, bIsFirstColumn) {
        if (bIsFirstColumn && TableUtils.Grouping.isInTreeMode(oTable)) {
            var oRow = oCell.getParent();
            rm.openStart("span", oRow.getId() + "-treeicon");
            rm.class("sapUiTableTreeIcon");
            rm.attr("tabindex", "-1");
            oTable._getAccRenderExtension().writeAriaAttributesFor(rm, oTable, "TREEICON", {row: oRow});
            rm.openEnd();
            rm.close("span");
        }
        rm.renderControl(oCell);
    };

But I can't see where the margin-left get's generated, it doesn't seem to be in any of the CSS classes mentioned above. Any idea where it comes from?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!