Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference > Methods for the List Object >

About the Custom Handler for a List Object


The custom handler for a List object has the format colorFunction(row). The JavaScript API framework provides the row parameter, corresponding to a ListRow object, when calling the custom function.

For inline editing, the row object corresponds to the row in which the inline editing occurs.

For initial page load and paging, the custom handler is called for each row in the list with the same logic applying for each row. For example, for a list of 25 rows, the JavaScript API framework calls the custom handler 25 times, providing the row parameter with values 0 through 24 (that is row# 0 through row count -1). Rather than looping, you only need to focus on the logic for row criteria and color setting. If you need to apply some special logic for a particular row, you can check the listRow.rowNum property.

The following is an example of pseudocode for a custom handler for a List object:

function otherColorHandler(row) {

if (row.getField("Location").getValue() = "Hometown") then

{

row.getField("Location").setColor("valueBgColor":"Black","valueTextColor":"Yellow");

}

}

listA = oraclecrmod.getList("AccountList");

listA.on("display",otherColorHandler);

For a full code sample, see Code Sample for Color Coding of Fields and Rows.

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