我有显示信息的问题。我需要设置Drop box.的值
来自clothing.json
的代码
{
"catalog": {
"clothing": {
"categories": [
{"name": "Women", "categories": [
{"name":"Clothing", "categories": [
{"name": "Dresses", "categories": [
{"name": "Casual Red Dress", "amount": 16.99, "currency": "EUR", "size": "S"},
{"name": "Short Black Dress", "amount": 47.99, "currency": "EUR", "size": "M"},
{"name": "Long Blue Dinner Dress", "amount": 103.99, "currency": "USD", "size": "L"}
]},
来自View.xml
的代码
<Column id="colSize" width="11rem">
<m:Label text="Size"/>
<template>
<m:Select
id = "selSize"
selectedKey="{size}"
items="{path: '/sizes', templateShareable: true}"
visible="{= !!${size}}"
forceSelection="false">
<core:Item key="{key}" text="{value}"/>
</m:Select>
</template>
</Column>
并从Controller.js
部分代码
onPressBtnSetSize: function() {
var oComboBox = this.byId("cbxSelectSize"),
sKey = oComboBox.getSelectedItem().getKey(),
oSelect = this.byId("selSize");
oSelect.setSelectedKey(sKey);
}
现在,当我调用方法getSelectedKey()
。我明白我的sKey
的意思。但表中的显示不会改变。
我认为你需要更新或刷新表。但我所有的尝试都失败了。请帮忙!
id = "selSize"
...
var oComboBox = this.byId("cbxSelectSize"),
?