SlideShare a Scribd company logo
1
Top ten tweaks for
the Interactive Grid
Roel Hartman
APEX Consulting
@RoelH
X
3
Tweaking the interactive grid
Copyright © 2017 APEX Consulting
Interactive Grid
The “basics”
5
6
7
Copyright © 2017 APEX Consulting
1. Tweak the Toolbar
Remove “Finder Drop Down”
8
Declarative settings for an IR
9
Declarative settings for an IG
10
JavaScript Configuration
11
JavaScript Configuration
12
function( options ) {
options.toolbar = false;
return options;
}
“toolbar” is just one of the options
13
apex.region("emp").widget().interactiveGrid("option").config
Disable “Finder Drop Down”
14
Disable “Finder Drop Down”
15
function( options ) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("search");
// toolbarGroup points to "search" object, containing “controls” array
// remove first element from that array
toolbarGroup.controls.shift();
// pass back the modified object
options.toolbarData = toolbarData;
return options;
}
Copyright © 2017 APEX Consulting
2. Tweak the Toolbar
Add a button on the Search Bar
16
Add a button on the Search Bar - IR
17
Add a button on the Search Bar - IG
18
function( options ) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions3");
// toolbarGroup is "actions3" object, with the "Add Row" button
// add an element to that array
toolbarGroup.controls.push({ type : "BUTTON"
, action : "my-custom-action"
, label : "My Button"
, icon : "fa fa-user-secret"
, iconBeforeLabel : true
});
// pass back the modified object
options.toolbarData = toolbarData;
return options;
}
Add a button on the Search Bar - IG (alt.)
19
function( options ) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = { id : “myToolBarGroup"
, controls : [{ type : "BUTTON"
, action : "my-custom-action"
, label : "My Button"
, icon : "fa fa-user-secret"
, iconBeforeLabel : true
}]
};
// toolbarGroup is my new created object
toolbarData.push( toolbarGroup );
// pass back the modified object
options.toolbarData = toolbarData;
return options;
}
Copyright © 2017 APEX Consulting
3. Tweak the Action Menu
Remove default functions
20
Declarative settings for an IR
21
Declarative settings for an IG
22
Remove default Actions
23
function( options ) {
options.initActions = function( actions ){
actions.hide("show-columns-dialog");
actions.hide("show-control-break-dialog");
actions.hide("show-aggregate-dialog");
actions.hide("show-help-dialog");
actions.hide("show-sort-dialog");
actions.hide("refresh");
// actions.hide("show-filter-dialog");
// actions.hide("show-flashback-dialog");
// actions.hide("show-highlight-dialog");
actions.disable("chart-view");
}
return options;
}
Remove default Actions (features)
24
function( options ) {
// Disable Filter / Flashback as "features"
options.features = options.features || {};
options.features.filter = false;
options.features.flashback = false;
return options;
}
Remove default Actions (Grid View features)
25
function( options ) {
// Disable Highlight "feature" of the Grid View
options.views = options.views || {};
options.views.grid = options.views.grid || {};
options.views.grid.features =
options.views.grid.features || {};
options.views.grid.features.highlight = false;
return options;
}
Copyright © 2017 APEX Consulting
4. Tweak the Action Menu
Add an Action to a Toolbar Button
26
Add a button on the Search Bar - IG
27
function( options ) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = { id : “myToolBarGroup"
, controls : [{ type : "BUTTON"
, action : "my-custom-action"
, label : "My Button"
, icon : "fa fa-user-secret"
, iconBeforeLabel : true
}]
};
// toolbarGroup is my new created object
toolbarData.push( toolbarGroup );
// pass back the modified object
options.toolbarData = toolbarData;
return options;
}
Link Action to Button
28
function( options ) {
…
options.initActions = function( actions ){
actions.add(
{ name : "my-custom-action"
, action : function( event, element ) {
apex.event.trigger( element, "my-custom-action" );
}
});
}
return options;
}
Copyright © 2017 APEX Consulting
5. Modify Column Headings
Remove sorting, hiding, aggregate etc.
29
Remove column header features
30
Remove column header features - region level
31
function( options ){
options.views = options.views || {};
options.views.grid = options.views.grid || {};
options.views.grid.features = options.views.grid.features||{};
options.views.grid.features.reorderColumns = false;
options.views.grid.features.resizeColumns = false;
options.views.grid.features.sort = false;
return options;
}
Where to find all these options?
32
Remove column header features - column level
33
function( options ){
options.features = options.features || {};
options.features.canHide = false;
options.features.controlBreak = false;
options.features.aggregate = false;
//options.features.freeze = false;
return options;
}
Reuse settings
• Create JavaScript function (in a - static - file)
34
function myColumnSettings( options ){
options.features = options.features || {};
options.features.canHide = false;
options.features.controlBreak = false;
options.features.aggregate = false;
return options;
}
• Call the function
myColumnSettings
Reuse settings and override
35
function( options ){
options = myColumnSettings( options );
options.features.aggregate = true;
return options;
}
• Call the function
Copyright © 2017 APEX Consulting
6. Modify Column Headings
Rotate column heading
36
Rotate column headings
37
Rotate column headings
38
.a-GV-header {
height: 120px;
}
.a-GV-w-hdr .a-GV-headerLabel {
transform: translateX(25%) rotate(45deg);
display: inline-block;
}
Copyright © 2017 APEX Consulting
7. Customise tooltips
Show “hidden” columns as a tooltip
39
Customise tooltip
40
Customise tooltip
41
function( options ){
options.defaultGridViewOptions =
{ tooltip:
{ content: function(callback, model, recordMeta, colMeta, columnDef ) {
return model.getValue( recordMeta.record, "JOB" ) +
"<br/>$" + model.getValue( recordMeta.record, "SAL" );
}
}
}
return options;
}
Copyright © 2017 APEX Consulting
8. Modify row menu
Delete and add entries
42
Modify row menu
43
Modify row menu
44
function(options) {
options.initActions = function( actions ) {
actions.remove("single-row-view");
actions.remove("row-add-row");
actions.remove("row-duplicate");
actions.remove("row-delete");
actions.remove("row-refresh");
actions.remove("row-revert");
actions.remove("selection-duplicate");
actions.remove("selection-delete");
actions.remove("selection-refresh");
actions.remove("selection-revert");
}
return options;
}
Modify row menu
45
apex.region("emp").widget()
.interactiveGrid("getViews").grid
.rowActionMenu$.menu("option")
.items.push({type:"action", label:"Hi", icon : "fa fa-hand-paper-o", action:
function(){alert("Hi y'all")}});
apex.region("emp").widget()
.interactiveGrid("getViews").grid
.selActionMenu$.menu("option")
.items.push({type:"action", label:"Hi", icon : "fa fa-thumbs-up", action:
function(){alert("Good work by all selected employees")}});
Modify row menu
46
Modify row menu
47
Copyright © 2017 APEX Consulting
9. Refresh row on change
without a full region refresh
48
Refresh (just the) row on change
49
Refresh (just the) row on change
50
Refresh (just the) row on change
51
Refresh (just the) row on change
52
Copyright © 2017 APEX Consulting
10. Refresh upon delete
without a full region refresh
53
Refresh upon delete
54
Refresh upon delete
55
Refresh upon delete
56
var records, recordId, iNode,
currentViewImpl = apex.region('emp').widget().interactiveGrid("getViews", "grid");
records = currentViewImpl.getSelectedRecords();
currentViewImpl.model.fetchRecords(records, function(err){
if (err) {
apex.message.clearErrors();
recordId = currentViewImpl.model.getRecordId(records[0]);
iNode = currentViewImpl.model.getRecordMetadata(recordId);
iNode.canDelete = true;
currentViewImpl.model.setOption('editable', true);
currentViewImpl.model.deleteRecords(records);
currentViewImpl.model.clearChanges();
}
});
Top ten
1. Remove objects from the standard Toolbar
2. Add objects to the standard Toolbar
3. Remove / disable standard Actions
4. Add your own Actions
5. Modify column functions
6. Modify column headings
7. Customise tooltips
8. Modify row level menu
9. Refresh (just the) row on change
10. Remove (just the) row on delete
57
Links to resources
• http://hardlikesoftware.com/weblog/2016/06/08/interactive-grid-under-the-hood/
• http://hardlikesoftware.com/weblog/2017/01/06/interactive-grid-column-widths/
• http://hardlikesoftware.com/weblog/2017/01/18/how-to-hack-apex-interactive-grid-part-1/
• http://hardlikesoftware.com/weblog/2017/01/24/how-to-hack-apex-interactive-grid-part-2/
• http://hardlikesoftware.com/weblog/2017/02/20/how-to-hack-apex-interactive-grid-part-3/
• http://hardlikesoftware.com/weblog/2017/03/31/how-to-hack-apex-interactive-grid-part-4/
• http://hardlikesoftware.com/weblog/2017/07/10/apex-interactive-grid-cookbook/
• https://github.com/mgoricki/orclapex-ig-cheat-sheet
• https://github.com/Dani3lSun/apex-plugin-extend_ig_menu
58
Copyright © 2017 APEX Consulting
Q& Aroel@apexconsulting.nl
http://www.apexconsulting.nl
@RoelH
59
@roelh
roel@apexconsulting.nl
http://www.apexconsulting.nl
Copyright © 2017 APEX Consulting
60

More Related Content

PPTX
Oracle Forms to APEX conversion tool
PPTX
Shaping Up Theme Roller Beyond Universal Theme
PDF
2 ways to get total sum of interactive grid column oracle apex ontoor blogs
PPTX
React hooks
PDF
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
PPTX
Functional programming with Java 8
PPTX
Capabilities for Resources and Effects
PPT
Oops concepts in php
Oracle Forms to APEX conversion tool
Shaping Up Theme Roller Beyond Universal Theme
2 ways to get total sum of interactive grid column oracle apex ontoor blogs
React hooks
PySpark Training | PySpark Tutorial for Beginners | Apache Spark with Python ...
Functional programming with Java 8
Capabilities for Resources and Effects
Oops concepts in php

What's hot (20)

PPTX
APEX Themes and Templates
PDF
REST API Best (Recommended) Practices
PDF
Introduzione ad angular 7/8
PPTX
Optional in Java 8
PDF
Flask Basics
PDF
Javascript Design Patterns
PDF
Quick flask an intro to flask
PDF
Oracle APEX Interactive Grid Essentials
PDF
Oracle APEX Cheat Sheet
PDF
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
PDF
Spring Cloud: Why? How? What?
PPTX
Introduction to java 8 stream api
PDF
Deep Dive Java 17 Devoxx UK
PDF
confirm & alert
PPTX
Oracle application express ppt
PDF
GraphQL Fundamentals
PDF
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
PDF
Advanced Postgres Monitoring
PPT
Django
PPTX
REST Easy with Django-Rest-Framework
APEX Themes and Templates
REST API Best (Recommended) Practices
Introduzione ad angular 7/8
Optional in Java 8
Flask Basics
Javascript Design Patterns
Quick flask an intro to flask
Oracle APEX Interactive Grid Essentials
Oracle APEX Cheat Sheet
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
Spring Cloud: Why? How? What?
Introduction to java 8 stream api
Deep Dive Java 17 Devoxx UK
confirm & alert
Oracle application express ppt
GraphQL Fundamentals
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
Advanced Postgres Monitoring
Django
REST Easy with Django-Rest-Framework
Ad

Similar to Tweaking the interactive grid (20)

PDF
Aplicacoes dinamicas Rails com Backbone
PPTX
Taming that client side mess with Backbone.js
PDF
Action bar
PPTX
Knockoutjs UG meeting presentation
ZIP
First Steps in Drupal Code Driven Development
PDF
Backbone.js — Introduction to client-side JavaScript MVC
PDF
Introduction to Web Components
PDF
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
PDF
sfDay Cologne - Sonata Admin Bundle
PDF
Bindings: the zen of montage
PPTX
Building complex User Interfaces with Sitecore and React
PDF
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
PDF
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
PDF
W-JAX 09 - Lift
PDF
Backbone.js: Run your Application Inside The Browser
PDF
Creating custom views
KEY
Jarv.us Showcase — SenchaCon 2011
PPT
Backbone js
PPTX
FunctionalJS - George Shevtsov
PPTX
1. George Shevtsov - Functional JavaScript
Aplicacoes dinamicas Rails com Backbone
Taming that client side mess with Backbone.js
Action bar
Knockoutjs UG meeting presentation
First Steps in Drupal Code Driven Development
Backbone.js — Introduction to client-side JavaScript MVC
Introduction to Web Components
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
sfDay Cologne - Sonata Admin Bundle
Bindings: the zen of montage
Building complex User Interfaces with Sitecore and React
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
W-JAX 09 - Lift
Backbone.js: Run your Application Inside The Browser
Creating custom views
Jarv.us Showcase — SenchaCon 2011
Backbone js
FunctionalJS - George Shevtsov
1. George Shevtsov - Functional JavaScript
Ad

More from Roel Hartman (20)

PDF
Wizard of ORDS
PDF
APEX Bad Practices
PDF
Docker for Dummies
PDF
A deep dive into APEX JET charts
PDF
My Top 5 APEX JavaScript API's
PDF
Mastering universal theme
PDF
APEX Developers : Do More With LESS !
PDF
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
PDF
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
PDF
APEX printing with BI Publisher
PDF
Troubleshooting APEX Performance Issues
PDF
Automated testing APEX Applications
PDF
5 Cool Things you can do with HTML5 and APEX
PDF
Striving for Perfection: The Ultimate APEX Application Architecture
PDF
XFILES, the APEX 4 version - The truth is in there
PDF
Done in 60 seconds - Creating Web 2.0 applications made easy
PPTX
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
PPTX
Creating sub zero dashboard plugin for apex with google
PPTX
Integration of APEX and Oracle Forms
PPT
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Wizard of ORDS
APEX Bad Practices
Docker for Dummies
A deep dive into APEX JET charts
My Top 5 APEX JavaScript API's
Mastering universal theme
APEX Developers : Do More With LESS !
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
APEX printing with BI Publisher
Troubleshooting APEX Performance Issues
Automated testing APEX Applications
5 Cool Things you can do with HTML5 and APEX
Striving for Perfection: The Ultimate APEX Application Architecture
XFILES, the APEX 4 version - The truth is in there
Done in 60 seconds - Creating Web 2.0 applications made easy
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Creating sub zero dashboard plugin for apex with google
Integration of APEX and Oracle Forms
Developing A Real World Logistic Application With Oracle Application - UKOUG ...

Recently uploaded (20)

PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
medical staffing services at VALiNTRY
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Introduction to Artificial Intelligence
PDF
top salesforce developer skills in 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Nekopoi APK 2025 free lastest update
PDF
AI in Product Development-omnex systems
PPTX
Online Work Permit System for Fast Permit Processing
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Odoo Companies in India – Driving Business Transformation.pdf
medical staffing services at VALiNTRY
Design an Analysis of Algorithms II-SECS-1021-03
Introduction to Artificial Intelligence
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 2 - PM Management and IT Context
Understanding Forklifts - TECH EHS Solution
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How to Migrate SBCGlobal Email to Yahoo Easily
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Internet Downloader Manager (IDM) Crack 6.42 Build 41
ISO 45001 Occupational Health and Safety Management System
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Nekopoi APK 2025 free lastest update
AI in Product Development-omnex systems
Online Work Permit System for Fast Permit Processing

Tweaking the interactive grid

  • 1. 1 Top ten tweaks for the Interactive Grid Roel Hartman APEX Consulting @RoelH
  • 2. X
  • 3. 3
  • 5. Copyright © 2017 APEX Consulting Interactive Grid The “basics” 5
  • 6. 6
  • 7. 7
  • 8. Copyright © 2017 APEX Consulting 1. Tweak the Toolbar Remove “Finder Drop Down” 8
  • 12. JavaScript Configuration 12 function( options ) { options.toolbar = false; return options; }
  • 13. “toolbar” is just one of the options 13 apex.region("emp").widget().interactiveGrid("option").config
  • 15. Disable “Finder Drop Down” 15 function( options ) { var $ = apex.jQuery, toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(), toolbarGroup = toolbarData.toolbarFind("search"); // toolbarGroup points to "search" object, containing “controls” array // remove first element from that array toolbarGroup.controls.shift(); // pass back the modified object options.toolbarData = toolbarData; return options; }
  • 16. Copyright © 2017 APEX Consulting 2. Tweak the Toolbar Add a button on the Search Bar 16
  • 17. Add a button on the Search Bar - IR 17
  • 18. Add a button on the Search Bar - IG 18 function( options ) { var $ = apex.jQuery, toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(), toolbarGroup = toolbarData.toolbarFind("actions3"); // toolbarGroup is "actions3" object, with the "Add Row" button // add an element to that array toolbarGroup.controls.push({ type : "BUTTON" , action : "my-custom-action" , label : "My Button" , icon : "fa fa-user-secret" , iconBeforeLabel : true }); // pass back the modified object options.toolbarData = toolbarData; return options; }
  • 19. Add a button on the Search Bar - IG (alt.) 19 function( options ) { var $ = apex.jQuery, toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(), toolbarGroup = { id : “myToolBarGroup" , controls : [{ type : "BUTTON" , action : "my-custom-action" , label : "My Button" , icon : "fa fa-user-secret" , iconBeforeLabel : true }] }; // toolbarGroup is my new created object toolbarData.push( toolbarGroup ); // pass back the modified object options.toolbarData = toolbarData; return options; }
  • 20. Copyright © 2017 APEX Consulting 3. Tweak the Action Menu Remove default functions 20
  • 23. Remove default Actions 23 function( options ) { options.initActions = function( actions ){ actions.hide("show-columns-dialog"); actions.hide("show-control-break-dialog"); actions.hide("show-aggregate-dialog"); actions.hide("show-help-dialog"); actions.hide("show-sort-dialog"); actions.hide("refresh"); // actions.hide("show-filter-dialog"); // actions.hide("show-flashback-dialog"); // actions.hide("show-highlight-dialog"); actions.disable("chart-view"); } return options; }
  • 24. Remove default Actions (features) 24 function( options ) { // Disable Filter / Flashback as "features" options.features = options.features || {}; options.features.filter = false; options.features.flashback = false; return options; }
  • 25. Remove default Actions (Grid View features) 25 function( options ) { // Disable Highlight "feature" of the Grid View options.views = options.views || {}; options.views.grid = options.views.grid || {}; options.views.grid.features = options.views.grid.features || {}; options.views.grid.features.highlight = false; return options; }
  • 26. Copyright © 2017 APEX Consulting 4. Tweak the Action Menu Add an Action to a Toolbar Button 26
  • 27. Add a button on the Search Bar - IG 27 function( options ) { var $ = apex.jQuery, toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(), toolbarGroup = { id : “myToolBarGroup" , controls : [{ type : "BUTTON" , action : "my-custom-action" , label : "My Button" , icon : "fa fa-user-secret" , iconBeforeLabel : true }] }; // toolbarGroup is my new created object toolbarData.push( toolbarGroup ); // pass back the modified object options.toolbarData = toolbarData; return options; }
  • 28. Link Action to Button 28 function( options ) { … options.initActions = function( actions ){ actions.add( { name : "my-custom-action" , action : function( event, element ) { apex.event.trigger( element, "my-custom-action" ); } }); } return options; }
  • 29. Copyright © 2017 APEX Consulting 5. Modify Column Headings Remove sorting, hiding, aggregate etc. 29
  • 30. Remove column header features 30
  • 31. Remove column header features - region level 31 function( options ){ options.views = options.views || {}; options.views.grid = options.views.grid || {}; options.views.grid.features = options.views.grid.features||{}; options.views.grid.features.reorderColumns = false; options.views.grid.features.resizeColumns = false; options.views.grid.features.sort = false; return options; }
  • 32. Where to find all these options? 32
  • 33. Remove column header features - column level 33 function( options ){ options.features = options.features || {}; options.features.canHide = false; options.features.controlBreak = false; options.features.aggregate = false; //options.features.freeze = false; return options; }
  • 34. Reuse settings • Create JavaScript function (in a - static - file) 34 function myColumnSettings( options ){ options.features = options.features || {}; options.features.canHide = false; options.features.controlBreak = false; options.features.aggregate = false; return options; } • Call the function myColumnSettings
  • 35. Reuse settings and override 35 function( options ){ options = myColumnSettings( options ); options.features.aggregate = true; return options; } • Call the function
  • 36. Copyright © 2017 APEX Consulting 6. Modify Column Headings Rotate column heading 36
  • 38. Rotate column headings 38 .a-GV-header { height: 120px; } .a-GV-w-hdr .a-GV-headerLabel { transform: translateX(25%) rotate(45deg); display: inline-block; }
  • 39. Copyright © 2017 APEX Consulting 7. Customise tooltips Show “hidden” columns as a tooltip 39
  • 41. Customise tooltip 41 function( options ){ options.defaultGridViewOptions = { tooltip: { content: function(callback, model, recordMeta, colMeta, columnDef ) { return model.getValue( recordMeta.record, "JOB" ) + "<br/>$" + model.getValue( recordMeta.record, "SAL" ); } } } return options; }
  • 42. Copyright © 2017 APEX Consulting 8. Modify row menu Delete and add entries 42
  • 44. Modify row menu 44 function(options) { options.initActions = function( actions ) { actions.remove("single-row-view"); actions.remove("row-add-row"); actions.remove("row-duplicate"); actions.remove("row-delete"); actions.remove("row-refresh"); actions.remove("row-revert"); actions.remove("selection-duplicate"); actions.remove("selection-delete"); actions.remove("selection-refresh"); actions.remove("selection-revert"); } return options; }
  • 45. Modify row menu 45 apex.region("emp").widget() .interactiveGrid("getViews").grid .rowActionMenu$.menu("option") .items.push({type:"action", label:"Hi", icon : "fa fa-hand-paper-o", action: function(){alert("Hi y'all")}}); apex.region("emp").widget() .interactiveGrid("getViews").grid .selActionMenu$.menu("option") .items.push({type:"action", label:"Hi", icon : "fa fa-thumbs-up", action: function(){alert("Good work by all selected employees")}});
  • 48. Copyright © 2017 APEX Consulting 9. Refresh row on change without a full region refresh 48
  • 49. Refresh (just the) row on change 49
  • 50. Refresh (just the) row on change 50
  • 51. Refresh (just the) row on change 51
  • 52. Refresh (just the) row on change 52
  • 53. Copyright © 2017 APEX Consulting 10. Refresh upon delete without a full region refresh 53
  • 56. Refresh upon delete 56 var records, recordId, iNode, currentViewImpl = apex.region('emp').widget().interactiveGrid("getViews", "grid"); records = currentViewImpl.getSelectedRecords(); currentViewImpl.model.fetchRecords(records, function(err){ if (err) { apex.message.clearErrors(); recordId = currentViewImpl.model.getRecordId(records[0]); iNode = currentViewImpl.model.getRecordMetadata(recordId); iNode.canDelete = true; currentViewImpl.model.setOption('editable', true); currentViewImpl.model.deleteRecords(records); currentViewImpl.model.clearChanges(); } });
  • 57. Top ten 1. Remove objects from the standard Toolbar 2. Add objects to the standard Toolbar 3. Remove / disable standard Actions 4. Add your own Actions 5. Modify column functions 6. Modify column headings 7. Customise tooltips 8. Modify row level menu 9. Refresh (just the) row on change 10. Remove (just the) row on delete 57
  • 58. Links to resources • http://hardlikesoftware.com/weblog/2016/06/08/interactive-grid-under-the-hood/ • http://hardlikesoftware.com/weblog/2017/01/06/interactive-grid-column-widths/ • http://hardlikesoftware.com/weblog/2017/01/18/how-to-hack-apex-interactive-grid-part-1/ • http://hardlikesoftware.com/weblog/2017/01/24/how-to-hack-apex-interactive-grid-part-2/ • http://hardlikesoftware.com/weblog/2017/02/20/how-to-hack-apex-interactive-grid-part-3/ • http://hardlikesoftware.com/weblog/2017/03/31/how-to-hack-apex-interactive-grid-part-4/ • http://hardlikesoftware.com/weblog/2017/07/10/apex-interactive-grid-cookbook/ • https://github.com/mgoricki/orclapex-ig-cheat-sheet • https://github.com/Dani3lSun/apex-plugin-extend_ig_menu 58
  • 59. Copyright © 2017 APEX Consulting Q& Aroel@apexconsulting.nl http://www.apexconsulting.nl @RoelH 59