Skip to Content
0

FacetFilter Json model and js binding path

Apr 05, 2017 at 05:49 AM

12

avatar image

Hello friends

I use FacetFilter with it's type = Light. I have one problem list is binding but it's item not binding and i have no idea how it bind. So please help me.

My JSON Format

{
"filters": [
{
"Title": "title1",
"Key": "1",
"Items": [
{
"Key": "k1",
"Text": "test1"
},
{
"Key": "k1",
"Text": "test2"
}
]
},
{
"Title": "title2",
"Key": "2",
"Items": [
{
"Key": "a1",
"Text": "test3"
},
{
"Key": "a2",
"Text": "test4"
}
]
}
]
}

View.js

And My Code

var oFacetFilter = new sap.m.FacetFilter({
showPersonalization: true,
showReset: true,
type: 'Light',
lists: {
path: "oFactModel>/filters",
template: new sap.m.FacetFilterList({
title: "{oFactModel>Title}",
growing: true,
items: {
path: "/Items",
template: new sap.m.FacetFilterItem({
text: "{Text}",
key: "{Text}"
})
}
})
}
});

Controller.js

onInit :function(){

var oFactModel = new sap.ui.model.json.JSONModel('model/data.json');
oFactModel.setDefaultBindingMode(sap.ui.model.BindingMode.OneWay);
sap.ui.getCore().byId("app").setModel(oFactModel, 'oFactModel');

}

Please help me.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers