Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference >

Methods for the List Object


Table 7 describes the methods that are available for the List object. These methods are used for color coding in lists.

Table 7. Methods for the List Object
Method Name
Return Type
Description
Sample Code
Notes

getRow(Row#)

ListRow

Returns the specific row in the displayed list based on the Row# parameter.

listRow= listObject.getRow(0);

The first row has index 0 and the last row has index getDisplayedCount()-1.

If the Row# value is invalid, then null is returned.

getDisplayedCount()

Integer

Returns the total number of rows displayed on the screen.

x = listObject.getDisplayedCount();

None

on(event,customhandler)

this

Registers a custom handler for the list currently displayed on the screen.

NOTE:  The framework passes the custom handler a row parameter, see About the Custom Handler for a List Object.

function myColorHandler(row){

//Change column YYY's color based on column XXX's value

if (row.getField("XXX").getValue()=="High"){

row.getField("YYY").setColor(...);

}

//Special logic for first row

if (row.rowNum == 0){

row.setColor(...);

}

}

listObj.on("display",myColorHandler);

For initial page load and paging, the handler is called for each row on the list.

For inline editing, the row object that is passed to the custom handler is based on the row on which the inline edit was processed.

The event parameter must be "display".

off(event)

this

Removes the custom handler

listObj.off("display");

If the event parameter is not "display", it is ignored and the custom handler is not removed.

Oracle CRM On Demand JavaScript API Developer's Guide, Release 38 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Legal Notices.