0

我的 IG 上有一个自定义按钮,应该打开一个模式对话框页面。这是我使用的代码:

function(config) {
   var $ = apex.jQuery,
     toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
     toolbarGroup = toolbarData.toolbarFind("actions4"); 


     toolbarGroup.controls.push( {
         type: "BUTTON",
         label: "My Button",    
         action: "my-action",
         hot: true
     });

    config.toolbarData = toolbarData;

     config.initActions = function( actions ) {     
         actions.add( {
         name: "my-action",
         label: "My Action",
         action: function(event, focusElement) {
             javascript:apex.navigation.dialog('f?p=&APP_ID.:2:&SESSION.');
         }
      } );

   }
   return config;
}

当我运行页面并单击按钮时,控制台中出现错误:

Error in action for 'my-action'. TypeError: Cannot read property 'dialogClass' of undefined

我该如何解决?

4

1 回答 1

0

如果您查看 JavaScript 文档,则必须为 apex.navigation.dialog 函数提供额外的参数:

https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/apex.navigation.html#.fn:dialog


    apex.navigation.dialog(
      url,
      {
        title: 'Orders',
        height: '480',
        width: '800',
        modal: true,
        resizable: true
      },
      'a-Dialog--uiDialog',
      $('#mybutton_static_id')
    );

于 2020-02-21T23:24:39.660 回答