Customizing Cell Rendering
![]() |
Note Number formatting is explained in more detail in the next section.
|
Code editor
- The cell value.
- The cell render action: filter, display, type or sort. These correspond to the actions performed when cells are rendered—in most cases, you can ignore this and return the same value for all render actions.
- The values from each cell in the corresponding row.
The render function can be provided inline within the vdl-table-column render attribute, or you can reference a function that has previously been defined in the view, allowing functions to be shared between multiple columns.
<vdl version="4.7"> <vdl-page> <script> function formatFrac(original) { return insight.Formatter.formatNumber(original, '00%'); } </script> <vdl-section heading="Welcome to Portfolio Optimization" heading-level="1"> <vdl-row> <vdl-column heading="Recommended share allocations" heading-level="3"> <vdl-table page-mode="paged" page-size="5" show-filter="true" column-filter="true"> <vdl-table-column entity="Shares_fraction" size="2" render="=formatFrac"></vdl-table-column> <vdl-table-column entity="Shares_Return" size="2" render="=function(data, type, row) { return data + ' percent';}"></vdl-table-column> </vdl-table> </vdl-column> </vdl-row> </vdl-section> </vdl-page> </vdl>
Render Function Applied to Table Cells
Which renders as follows:

function italic(data, type, row) { data = data ? data : ''; if (type === 'display') { return 'Italic text ' + _.escape(data) + ''; } else if (type === 'copy') { return data + ' (in italics)'; } return data; }In this case, if the cell is rendered following a copy action, the contents of the cell are rendered in italics.
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.