选择器或 ComboBox 在 SAPUI5 中不显示所有 JSON
Selector or ComboBox does not display all JSON in SAPUI5
我有 JSON 个国家,我想要在组合框或选择器中显示 json 的所有属性,但它只显示 99 个,就好像正在划分数组,有什么办法可以解决这个问题吗?我的 json 有大约 200 个属性。这是json:
的一小部分
{
"countries": [
{
"name_en": "Afghanistan",
"name_es": "Afganistán",
"nationality_en": "Afghan",
"nationality_es": "Afgano/a",
"dial_code": "+93",
"code": "af"
},
{
"name_en": "Albania",
"name_es": "Albania",
"nationality_en": "Albanian",
"nationality_es": "Albano/a",
"dial_code": "+355",
"code": "al"
},
{
"name_en": "Algeria",
"name_es": "Argelia",
"nationality_en": "Algerian",
"nationality_es": "Argelino/a",
"dial_code": "+213",
"code": "dz"
}
]}
这是观点:
<Label class="label" text="{i18n>Nationality}" required="true"/>
<ComboBox id="comboNationality" placeholder="{i18n>Nationality}" class="input" width="100%" required="true" tooltip="{i18n>SelectNationality}" items="{ path: 'country>/Dato' }">
<core:ListItem key="{country>code}" text="{country>nationality}"/>
</ComboBox>
知道为什么它会削减 json 吗?
JSONModel 的默认大小为 100 个元素。您可以使用 setSizeLimit 方法来更改此行为
我有 JSON 个国家,我想要在组合框或选择器中显示 json 的所有属性,但它只显示 99 个,就好像正在划分数组,有什么办法可以解决这个问题吗?我的 json 有大约 200 个属性。这是json:
的一小部分{
"countries": [
{
"name_en": "Afghanistan",
"name_es": "Afganistán",
"nationality_en": "Afghan",
"nationality_es": "Afgano/a",
"dial_code": "+93",
"code": "af"
},
{
"name_en": "Albania",
"name_es": "Albania",
"nationality_en": "Albanian",
"nationality_es": "Albano/a",
"dial_code": "+355",
"code": "al"
},
{
"name_en": "Algeria",
"name_es": "Argelia",
"nationality_en": "Algerian",
"nationality_es": "Argelino/a",
"dial_code": "+213",
"code": "dz"
}
]}
这是观点:
<Label class="label" text="{i18n>Nationality}" required="true"/>
<ComboBox id="comboNationality" placeholder="{i18n>Nationality}" class="input" width="100%" required="true" tooltip="{i18n>SelectNationality}" items="{ path: 'country>/Dato' }">
<core:ListItem key="{country>code}" text="{country>nationality}"/>
</ComboBox>
知道为什么它会削减 json 吗?
JSONModel 的默认大小为 100 个元素。您可以使用 setSizeLimit 方法来更改此行为