0

is there a simple example which showcases TreeTable control using ODataService which calls your backend tables. I came across this example->http://scn.sap.com/community/developer-center/front-end/blog/2015/10/23/treetable-odata-binding but this does not concrete explanation how it could be embedded in view instead of doing it via html.

Thank you!

EDIT1:

So I followed the examples, and what I have now is a columns reading a field from the service and displaying in one of the table columns.

What I need now is the relationship to be shown (Parent-child) using tree table control. For that I have a backend with CDS view and association defined as well. Using the tx SEGW, I also have my Entities and association sets generated from the CDS view. This generates runtime arifacts which are the DPC and MPC classes.

For getting the relationship right, the view is defined as below:

<TreeTable
    id="treeTable"
    selectionMode="Single"
    enableColumnReordering="false"
    expandFirstLevel="false"
    rows="{
        path : '/entity_name',
        parameters : {
            countMode: 'Inline',
            treeAnnotationProperties : {
                hierarchyLevelFor : 'Parent',
                hierarchyNodeFor : 'Child',
            }
        },
     properties : {
                    expand : 'relationship_name',  
                    navigation : {
                    'entity_name' : 'relationship_name'
                    }
                }
    }">
    <columns>
        <Column label="Parent">
        <template>
        <m:Text text="{pnode}"/>
        </template>
        </Column>
        <Column label="Child">
        <template>
        <m:Text text="{cnode}"/>
        </template>
        </Column>
    </columns>

  </TreeTable>

I am using WebIDE quick start application. I added my ODataService to this project. Manifest.json has been updated to use "data source"-> "main source"" as my service name.

I have following error: Neither navigation paths parameters, nor (complete/valid) tree hierarchy annotations where provided to the TreeBinding.

Do i need to annotate my CDS view?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
qwerty
  • 163
  • 3
  • 12

0 Answers0