SAPUI5-表-XML-如何使用XML视图制作SAPUI5表 [英] SAPUI5 - Table - XML - How to make a SAPUI5 table with XML Views
问题描述
我想制作一个仅包含XML视图的简单表. 但是我找不到任何能告诉我如何做的东西.如何告诉表格应使用哪个型号?如何告诉表格应将哪个列与模型中的哪个条目绑定?
I want to make a simple table with only XML Views. But I can't find anything that's telling my, how to. How do I tell the table which Model it should use? How do I tell the table which column should be bind with which entry in the model?
我知道如何定义列.我的数据(暂时)存储在.json文件中.以后我想使用OData服务.
I know how to define the columns. My data is stored (for the moment) in a .json file. Later I want to use a OData service.
这是一些代码:
<Table>
<items></items><!-- sap.m.ListItemBase -->
<columns>
<Column>
<Label text="Date"/>
</Column>
<Column>
<Label text="Article"/>
</Column>
</columns><!-- sap.m.Column -->
</Table>
在Table
标签中是否存在将模型绑定到数据的items
属性?
Is there a items
attribute in the Table
tag where I bind the Model to the data?
我认为必须在<items>
标记中定义一个ListItemBase
,但看不到如何绑定模型入口"和列".
I think in the <items>
tag there I must define a ListItemBase
but I cann't see how to bind Model Entry and Column.
<items>
<ListItemBase
id="id"
busy="false"
busyIndicatorDelay="1000"
visible="true"
fieldGroupIds="[]"
type="Inactive"
visible="true"
unread="false"
selected="false">
</ListItemBase>
</items><!-- sap.m.ListItemBase -->
推荐答案
在互联网上进行的其他搜索解决了我的问题:
Some more search in the internet solved my question:
通过<Table items="{/model}">
将数据绑定到表中.
Bind the data to the table via <Table items="{/model}">
.
要告诉表格要使用模型中的哪些条目,请使用:
To tell the table which entries in your model to use, use:
<items>
<ColumnListItem>
<cells>
<Label text="{text1}" />
<Label text="{text2}" />
</cells>
</ColumnListItem>
</items>
或者您使用<ObjectIdentifier>
.
但是为什么WebIDE告诉我使用<ListItemBase>
而不使用<ColumnListItem>
.仅仅是WebIDE中的错误,还是我在这里出错了?
But why is the WebIDE telling me, to use <ListItemBase>
but not <ColumnListItem>
. Is it just a bug in the WebIDE or do I get something wrong here?
这篇关于SAPUI5-表-XML-如何使用XML视图制作SAPUI5表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!