如何动态过滤树表?

时间:2019-11-07 11:47:54

标签: javascript xml sapui5

渲染视图后,当我要从中选择一些值时要根据选择来过滤过滤器树表

我尝试了两种都不起作用的方法

Tried way 1.
this.getView().byId("ingredientsTableIngList").getBinding("rows").filter([new sap.ui.model.Filter("IsDeclared", sap.ui.model.FilterOperator.EQ, true)])

Tried Way 2.
this.getView().byId("ingredientsTableIngList").bindRows({
                path: "/someProperty",
                filters: [new sap.ui.model.Filter("IsDeclared", sap.ui.model.FilterOperator.EQ, false)],
                parameters:{
                    countMode: "Inline",
                    numberOfExpandedLevels: 10,
                    treeAnnotationProperties: {
                        hierarchyLevelFor: "HierarchyLevel",
                        hierarchyNodeFor: "RowIndex",
                        hierarchyParentNodeFor: "ParentIndex",
                        hierarchyDrillStateFor: "DrillDownState"
                    }
                }
            });

没有错误

0 个答案:

没有答案