主细节模板
单击 Master[list]
时,它将导航到包含表数据的详细信息页面,假设有四列,最后一列中有"Add" Button . 现在我想要的是,点击"Add"按钮,行数据将直接在购物车视图中绑定 .
我尝试使用本地存储,但如何在购物车视图中调用本地存储的数据 .
Cart view is on Master page with icon
On click cart icon view page is this
onPress: function(evt){
localStorage.setItem('user', JSON.stringify({
a : evt.oSource.oParent.mAggregations.cells[0].mProperties.src,
b : evt.oSource.oParent.mAggregations.cells[1].mProperties.text,
c : evt.oSource.oParent.mAggregations.cells[2].mProperties.text,
d : evt.oSource.oParent.mAggregations.cells[3].mProperties.text
}));
user = JSON.parse(localStorage.getItem('user'));
}
1 回答
我假设你使用UI5路由器和ODataModel resp在基于组件的应用程序中 . 服务 .
您可以通过路由将表条目的ID传递到详细信息视图:
来自routing.config.routes:
Note :
{param}
将参数标记为必需参数,而:param:
用于可选参数 .在您的Detail.controller.js中,在routePatternMatched上注册一个监听器,并按如下方式实现它: