Help Center/ Huawei Cloud Astro Zero/ FAQs/ Application Frontend Development/ What Should I Do If I Do Not Want to Close the Pop-up Window in the onOk Event on a Standard Page?
Updated on 2025-08-14 GMT+08:00

What Should I Do If I Do Not Want to Close the Pop-up Window in the onOk Event on a Standard Page?

Description

I do not want to close the pop-up window in the onOk event on a standard page.

Figure 1 Customizing JavaScript code

Solution

The onOK event is preset in the system and cannot prevent the window from closing. To address similar needs, set footerHide to true to hide the default function buttons in the pop-up window. This will allow the pop-up to use the function buttons from the service page, where you can implement logic for validation, prompts, and closing behavior within the button events.

context.$dialog.popup({
  title: 'Title',
  page: '{{pagename}}',
  width: 600,
  height: 500,
  footerHide: true, //Modify the customized function buttons.
  showCancel: true,
  okText: 'ok',
  params: {},
});