on 2020 Jan 07 11:19 AM
Hi All,
I am working on SAPUI5 Custom development. In my application scenario, i need to use Treatable to display the values in hierarchy level. I followed the below SAPUI5 Explored example to do that.
Link : Tree Table with Annotaions
It is working as expected.
View.xml:
<TreeTable id="treeTable" selectionMode="None" enableColumnReordering="false"
alternateRowColors="true" rows="{ path : 'test>/TreeViewTestSet', parameters : { countMode: 'Request', numberOfExpandedLevels: 0 } }">
<columns>
<Column hAlign="Center" width="12em">
<m:Label text="{i18n>master_form_label_plant}" design="Bold"/>
<template>
<m:Text text="{test>Description}" wrapping="false"/>
</template>
</Column>
</TreeTable>
Now i need to pass the additional filter to this Treatable Collection. I dont know how to pass the additional filters to the table.
I tried the below approach to enable the filter, but it does not works. I had a thought of sending the required filters to the entityset via controller and tried to bind the response to the sap.ui.treeTable aggregations.
Below code which i tried:
oModel.read("/TreeViewTestSet", {
filters: aDateFilter,//my additional filters
success: function (results, response) {
debugger;
that.getModel("test")
.setProperty("/TreeViewTestSet", results);
//how to update this model to my sap.ui.treeTable.
},
error: function (oError) {
MessageToast.show("Error");
}
});
It does not work, when i try to use bindRows method for the treeTable, it starts from the hierarchylevel 0 without the date value (i applied via filter).
Thank you,
Regards,
JK.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi I got the solution. I used the aggrgation in both places, view and controller. so that whatever the chnages i did in the controller is overridden at view. Now i removed the rows aggreagtion in the view, fully maintained in the controller by using the id and bindRows() method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try .setData and check the path/structure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.