Hi experts,
I have create a master and detail page in my application.
When I bind the data from odata to the list of master page it works fine but when I bind the data from local json file it does not work.
{
"Item": [{
"Emp_ID": "H247070",
"Emp_Name": "Sidhant Acharya"
}, {
"Emp_ID": "H247071",
"Emp_Name": "Json Smith"
}, {
"Emp_ID": "H247072",
"Emp_Name": "John Canedy"
}, {
"Emp_ID": "H247073",
"Emp_Name": "Barak Obama"
}, {
"Emp_ID": "H247074",
"Emp_Name": "Ricky Martin"
}, {
"Emp_ID": "H247075",
"Emp_Name": "Priya Sharma"
}]
}
//List to display the list in page of master view
olistCatgery = new sap.m.List("Id", {
includeItemInSelection : true,
inset : true,
growing:true,
itemPress : function(oEvent) { //Item Press Event
oController.onSelect(oEvent); }
});
//Search bar
var oBar = new sap.m.Bar('searchBar',{
contentMiddle:[
new sap.m.SearchField('search',{
id:'searchField',
tooltip: 'Do some search...',
placeholder: 'Search',
showRefreshButton: true,
refreshButtonTooltip: 'Refresh',
showNavButton: true,
liveChange:oController.onSearch})
]})
//Template in the list to display the items
oTemplate = new sap.m.StandardListItem("idItems", {
title : "{Emp_ID}",
description: "{Emp_Name}",
type : sap.m.ListType.Navigation,
});
//Bind the data to the template
olistCatgery.bindAggregation( "items", {
path : "/item",
template: oTemplate
});


Add comment