Custom events

The events described below are jQuery custom events. You can handle these events in JavaScript to customize an application that uses the new UI. Infinite Blue recommends using the function addEventListener() to handle custom events. See http://www.w3schools.com/jquery/jquery_events.asp for more information about jQuery events.

Platform supports the following custom events:

  • rb.newui.util.customEvents.rbs_pageRender — Raised when the AJAX response has been received from the server and the content has been rendered in the content element. This will be raised regardless of whether AJAX navigation is enabled. You can handle this event in a JavaScript event handler in a script component to customize the content on the page.
    Note: With AJAX navigation enabled, use a call to addEventListener() for this event instead of document.ready. See addEventListener() for an example.
    See HTML and Script components for more information about script components.
  • rb.newui.util.customEvents.rbs_recordsSelected — Raised when records are selected from a record list view
  • rb.newui.util.customEvents.rbs_recordSelectionCleared — Raised when selected records in a record list view are cleared
  • rb.newui.util.customEvents.rbs_sectionCollapsed — Raised when an expanded page section is collapsed, after the collapse is complete
  • rb.newui.util.customEvents.rbs_sectionExpanded — Raised when a collapsed page section is expanded, after the expansion is complete
  • rb.newui.util.customEvents.rbs_uiResized — Raised when the layout manager has finished resizing the screen. You can use a handler for this event to perform post-sizing operations.
  • rb.newui.util.customEvents.rbs_tabActivated — Raised when a page tab is activated and is fully visible on the page
  • rb.newui.util.customEvents.rbs_viewSelectorChange — Raised when a user selects a different view on a record list page
  • rb.newui.util.customEvents.rbs_sessionExtended — Raised when a user extends a session from the notification that session is about to expire
  • rb.newui.util.customEvents.rbs_notificationDisplayed — This event is for post processing after a Growl message is displayed. The following parameters are passed in the data parameter as an object:
    • type — The type of the Growl message
    • title — The title of the Growl message
    • message — The Growl message
  • rb.newui.util.customEvents.rbs_gridControlFieldUpdate — Raised when the user updates a field in a grid control. See GridControl for more information.
  • rb.newui.util.customEvents.rbs_gridControlRowCreate — Raised when the user creates a new record in a grid control. See GridControl for more information.
  • rb.newui.util.customEvents.rbs_gridControlRowDelete — Raised when the user deletes a record in a grid control. See GridControl for more information.
    Note: These custom events are not supported in portals.

The following example illustrates how to add an event listener and handler for this event:

<script>
try{    
  if(!rbf_isNewUI()) {    
throw'This Script is written specific to New UI Context';  
  }     
// { type: type, title: title, message: message }  
var onNotificationDisplayed = function(event,data){    
if(console){      
  console.log("**** Processing event rbs_notificationDisplayed ****");      
  console.log("Type: "+ data.type);      
  console.log("Title: "+ data.title);      
  console.log("Message: "+ data.message);    
  }  
};       
rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_notificationDisplayed,
  onNotificationDisplayed);} 
catch(err) {  
  if(console) {    
    console.log(err);  
}}
</script>

CustomEvent for Dynamic Filter Rendering

You can delay rendering the filter section when using for the first time. If you have JavaScript to customize filter component, adapt it to run the code after the filter component is rendered. You need to listen to the custom event rbs_dynamicFilterRendered and execute your customization code in the callback function as exemplified below.

<script>
try { 
  if (!rbf_isNewUI()) {
    throw 'This Script is written for New UI';
  }
   
  var onFilterRender = function ( event, eventData) {
    // Now customize the filter the way you want.
    // Event Data: { filterEle: theFilterElement, cellId: theCellId, cellOrgId: theCellOriginalId }
  };
   
  rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_dynamicFilterRendered, onFilterRender);
 
}
catch (err) {
  if (console) {
    console.log(err);
  }
}
</script>