SAPUI5列表刷新更新但工作不正常
我有一个带有复选框的列表,它按顶部的勾号排序,而不是底部的勾号排序 我已将分拣机放置到位,它会在勾选时刷新,但无论我选中哪个复选框,它都会保持在原位,但标签实际上会移动 在选择“前台商店”之前 选择“前台商店”后 列表会自动刷新,前店商品会移至顶部(当分拣机就位时),但在我选中位置3中的复选框时,勾号会在刷新后保留在那里 查看SAPUI5列表刷新更新但工作不正常,sapui5,Sapui5,我有一个带有复选框的列表,它按顶部的勾号排序,而不是底部的勾号排序 我已将分拣机放置到位,它会在勾选时刷新,但无论我选中哪个复选框,它都会保持在原位,但标签实际上会移动 在选择“前台商店”之前 选择“前台商店”后 列表会自动刷新,前店商品会移至顶部(当分拣机就位时),但在我选中位置3中的复选框时,勾号会在刷新后保留在那里 查看 <List id="listCategories" noDataText="{i18n>noCategories}" items="{path:'/Cat
<List id="listCategories" noDataText="{i18n>noCategories}" items="{path:'/CategorySet',parameters:{select:'CategoryDesc,CategoryId,Active'},sorter:[{path:'Active',descending:true},{path:'CategoryDesc',descending:false}]}" headerText="{i18n>active}" class="sapUiMediumMarginTop rightAlign">
<items>
<InputListItem label="{CategoryDesc}">
<!-- If there is an X in the Active field, set the state of the CheckBox to TRUE -->
<CheckBox selected="{= ${Active} ==='X' ? true : false }" select="onSwitch"/>
</InputListItem>
</items>
</List>
// Set CheckBox status, X for true, blank for false
onSwitch: function(oEvent) {
var oEntry = {};
var bindingContext = oEvent.getSource().getBindingContext();
var path = bindingContext.getPath();
var object = bindingContext.getModel().getProperty(path);
oEntry.CategoryId = object.CategoryId;
oEntry.CategoryDesc = object.CategoryDesc;
if (oEvent.getParameter("selected") === true) {
oEntry.Active = "X";
} else {
oEntry.Active = "";
}
var oModel = this.getView().getModel();
oModel.create("/CategorySet", oEntry, {
success: function() {
if (oEntry.Active === "X") {
MessageToast.show("Category set as Active", { duration: 2000 });
}
if (oEntry.Active === "") {
MessageToast.show("Category set as Inactive", { duration: 2000 });
}
},
error: function(oError) {}
});
},