$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

sap.ui.table.TreeTable with oData: Prevent leafs having an expand icon

Hi all,

I try to use sap.u.table.TreeTable to show a hierarchy provided by an Odata service. I bind the data to the treetable in my controller like this:

oTreeTable.bindRows({
 path : "/HierarchyElementSet",
 filters : oFilters,
 parameters : {	navigation : {'HierarchyElementSet' : 'ChildNodes'}}
});

I define the treetable in a xml view like this:

<t:TreeTable id="parameter1TreeTable" selectionMode="Single" enableColumnReordering="true" expandFirstLevel="true" title="test">
 <t:columns>
  <t:Column label="{i18n>ElemID}">
   <t:template><Text text="{ElemId}" /></t:template>
  </t:Column>
  <t:Column id="ElemTextId" label="{i18n>ElemText}">
   <t:template><Text text="{ElemText}" /></t:template>
  </t:Column>
 </t:columns>
</t:TreeTable>

With this configuration my treetable looks like this:

test.png

My problem is that also the leafs (SP and SW) have a plus sign indicating to be expandable - although there are no children below them:

  • How can I prevent the leafs to have the expand icon?
  • Is there also a way to change the expand icon from +/- to >?

Thanks in advance for your help.

Best regards

Dan

test.png (1.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 26, 2017 at 02:54 PM

    UI5 version? its working for me for 1.28 and 1.38 UI5 versions.

    I believe this is not a bug nor your code issue, its all about data structure, just verify your data once again.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Do I have to remove the navigation property from my backend service, when using the treeAnnotations property?

      Perhaps this causes the "no-data" problem?

      As you can see in my controller I commented it out:

      oTreeTable.bindRows({
      				path : "/HierarchyElementSet",
      				events : {
                          dataRequested: function (oEvent) { oTreeTable.setBusy(true); },
                          dataReceived: function (oEvent) { oTreeTable.setBusy(false); }
                          },
      				filters : oFilters,
      				parameters : {
      					/*
      					navigation : {
      						'HierarchyElementSet' : 'ChildNodes'
      					}
      					*/
      					countMode: 'Inline',
      					treeAnnotationProperties : {
      						hierarchyLevelFor : 'HierLevel',
      						hierarchyNodeFor : 'SeqNr',
      						hierarchyParentNodeFor : 'ParentId',
      						hierarchyDrillStateFor : 'DrillDownState'
      					}
      				}
      			});
      

      But in my service implementation in the backend there is still a navigation property (although I am not using it):

      sap-gateway-service-builder-remote-2017-05-03-13-4.png