on 01-27-2017 9:03 AM
Hello,
Am trying to implement a tree table and fill data from a oData service and was successful in doing the same.
However am trying to apply a initial filter when the first odata service is triggered and tried the below code. But the filter parameters are not passed to the backend system.
Since its a tree table, the hierarchical level is always passed during the first call to Odata by default and would like to have my custom field to also be added in the filter.
var sUrl = "XXXXXXXXXXXXX";
// set model on component
this.getView().setModel(
new ODataModel(sUrl, {
json: true,
batch: true
})
);
var oFilters = [ new sap.ui.model.Filter(
"OrderNumberID", "EQ", "XXXXX") ];
var tab1 = this.getView().byId("TreeTableOpenOrders");
tab1.getBinding("rows").filter(oFilters); // No error but no data is passed
Might help someone in the future.
The below bind row addition did the trick.
var oFilters = [ new sap.ui.model.Filter("OrderNumberID", "EQ", "XXXXXXX") ];
var tab1 = this.getView().byId(
"TreeTableOpenOrders");
// set model on component
this.getView().setModel(
new ODataModel(sUrl, {
json: true,
batch: true
})
);
tab1.bindRows({
path: "/OrderHeaders",
filters: oFilters,
parameters: {
countMode: "Inline",
operationMode: "Server",
treeAnnotationProperties: {
hierarchyLevelFor : "HierLevel",
hierarchyNodeFor : "OrderNumberID",
hierarchyParentNodeFor : "SuperiorOrderNumber",
hierarchyDrillStateFor : "DrillState"
}
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.