oracle-apex - 如何在 Oracle APEX 中的交互式网格属性上使用“多个 JavaScript 函数”
问题描述
当我在交互式网格的属性上使用多个 JavaScript 函数时显示的空白页
我在交互式网格的属性上有一个 JS 函数,一切正常。
//first fuction
function(config) {
// if there were an option to turn off frozen columns we would do that
// row header was removed to avoid frozen column but still want multiple select
config.defaultGridViewOptions = {
multiple: true,
selectAll: true
};
config.initActions = function(actions) {
actions.lookup("change-rows-per-page").choices.shift(); // get rid of auto rows per page because that relies on fixed height.
}
return config;
}
//here when i add second function like added below my page goes blank
function(config) {
var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(), // Make a copy of the default toolbar
editSaveGroup = toolbarData.toolbarFind( "actions2" );
// If the employees detail dialog is going to have a Dialog Save button then the
// save action cannot be hidden (Toolbar Buttons Save unchecked). But rather
// need to remove the button from the toolbar.
// If not going to save then all this code can be removed and the
// attribute Toolbar Buttons Save unchecked.
editSaveGroup.controls.pop(); // remove Save button.
config.toolbarData = toolbarData;
return config;
}
我想在 ig 的属性上添加第二个 js 函数,但是当我添加第二个 js 函数时,页面显示空白页。
解决方案
交互式网格的 JavaScript 初始化代码作为一个回调函数,一旦加载网格就会执行。它是一个单一的 JS 函数。
您必须将两个函数合并为一个函数,如下所示:
function(config) {
// Make a copy of the default toolbar
var toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
editSaveGroup = toolbarData.toolbarFind("actions2");
// If the employees detail dialog is going to have a Dialog Save button then the
// save action cannot be hidden (Toolbar Buttons Save unchecked). But rather
// need to remove the button from the toolbar.
// If not going to save then all this code can be removed and the
// attribute Toolbar Buttons Save unchecked.
editSaveGroup.controls.pop(); // remove Save button.
config.toolbarData = toolbarData;
// if there were an option to turn off frozen columns we would do that
// row header was removed to avoid frozen column but still want multiple select
config.defaultGridViewOptions = {
multiple: true,
selectAll: true
};
config.initActions = function (actions) {
actions.lookup("change-rows-per-page").choices.shift();
}
return config;
}
推荐阅读
- c# - HttpClient 发布到授权角色属性操作
- swift - 无法理解 withUnsafeBytes 方法的工作原理
- react-native - 如何构建 ExpoKit APK
- configuration - Wildfly 没有上传大文件
- amazon-web-services - 如何为 AWS 实践实验室开发 Web 应用程序?
- reactjs - 正在寻找一个账单扫描 OCR 工具,我可以将它构建到 React Native App 中,用于学术项目。有什么建议么?
- microsoft-cognitive - QnA Maker 服务未显示在“我的知识库”中
- python - 由于数据库输入错误,切换到特定类别的列
- python - 如何在Django中动态调用模板中的视图函数
- node.js - 在 express.js 中使用 .unless 来避免对几个路由进行 jsonwebtoken 验证