frameModule.topmost().goBack();
所以,当我回到同一页面时,我需要一种选择项目的方法。
要帮助的点
当我回来时,我具有rad列表视图的选定数据。
exports.onNavigatingTo = function(args) {
const page = args.object;
page.bindingContext = CreateViewModel;
if (CreateViewModel.selected_dataItem)
console.log("present");
else
console.log("absent");
}
显示和隐藏工厂
itemSelecting: function(args) {
viewModel.selected_dataItem = args.view.bindingContext;
this.show_floating_action = "visible";
},
itemDeselecting: function(args) {
viewModel.selected_dataItem = "";
this.show_floating_action = "collapsed";
},
答案 0 :(得分:0)
您可以使用selectItemAt
。请按照以下步骤操作
pageLoaded function:-
if (vm.selected_dataItem) {
var radlistview = args.object.getViewById("radlistview"); // read id
radlistview.selectItemAt(CreateViewModel.selected_dataItem_index); // select it
}
当心错误bindingContext of undefined
,在下面的代码行中添加。
itemSelecting: function(args) {
*** add this line to your code
if (args.view) {
viewModel.selected_dataItem_index = args.index;
***
viewModel.selected_dataItem = args.view.bindingContext;
this.show_floating_action = "visible";
}
}