即使一个片段没有控制器,你也会看到
confirm="onSortDialogConfirmed"
在同一个控制器中,您可以得到
ViewSettingsDialog
Check this sample
打开一个对话框片段
it's code here
在您的场景中,您可以在打开片段的controller方法中尝试以下操作(参考上面的示例链接)
//Get the dialog instance
var oDialog = sap.ui.xmlfragment(this.getView().getId(), "path.of.your.fragment", this);
// connect dialog to view (models, lifecycle)
this.getView().addDependent(oDialog);
//Create a Sort Item and add it to the dialog
var oCustomSortItem = new sap.m.ViewSettingsItem({text:"New settings item"})
oDialog.addSortItem(oCustomSortItem);
oDialog.open();
ViewSettingsDialog documentation
ViewSettingsItem documentation