I want to change the compact density with a button.
onInit: function () {
this.getView().addStyleClass("sapUiSizeCompact");
},
works well. If I will change it in a button, it does not work.
onOpenDialog: function (oEvent) {
var oDialog1 = new Dialog();
// ...
oDialog1.addButton(new Button({
text: "OK",
press: function () {
// How can I point to the view from inside this function?
}
}));
oDialog1.open();
},
How can I point to the view from inside the function?