

Get in touch

Download Plugin Now
  • Follow
  • Follow
WP Data Access
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
a
M
M
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
Download Plugin Now

App Builder

  • Getting Started
  • App Builder Dashboard
  • Creating your first App
  • Running Apps
  • Export/Import Apps
  • Road Map
  • App Shortcodes
    • Shortcode Usage
    • Shortcode Parameters
    • URL Parameters

App Manager

  • Getting started
  • Supported App Types
  • Supported Languages
  • App Authorization and Access
  • Full-Screen Mode

Table Builder

  • Getting started
  • Relationships
  • Lookups
  • Computed Fields
  • Table
    • Global filter
    • Column filters
    • Bulk Actions
    • Row Actions
    • Column Actions
    • Default where
    • Default Order By
    • Pagination
    • Inline Editing Settings
    • Layout & Responsiveness
      • Responsiveness
      • Density
      • Table Header
      • Table Footer
  • Columns
    • Introduction
    • Column Settings
    • Column Actions
    • Lookup
    • Aggregations
    • Column Metadata
  • Performance
    • Large Table Support
    • Server/Client-Side Processing
  • Filters
    • Global filter
    • Column filters
    • Default where
    • URL parameters
    • Shortcode parameters

Form Builder

  • Getting started
  • Relationships
  • Lookups
  • Computed Fields
  • Form
    • Understanding the Grid
    • Field Layout
    • Column Behaviour
    • Null Value Handling
  • Columns
    • Column Settings
    • Validation
    • Lookup
    • Column Metadata
  • Layout & Behaviour
    • Grid Positioning

Map Builder

  • Getting started
  • Creating a map
  • Using maps

Chart Builder

  • Getting started
  • Creating a chart
  • Using charts

Hooks

  • Getting started with hooks
  • App Hooks
    • global
    • onAppOpen
    • onAppClose
  • Table Hooks
    • customActionsTop
    • customActionsBottom
    • postQuery
    • renderDetailPanel
    • Table Column Hooks
      • render
  • Form Hooks
    • customActionsBottom
    • onRowInit
    • preFormSubmit
    • postFormSubmit
    • Form Column Hooks
      • onBlur
      • onChange
      • onClick
      • onDoubleClick
      • onFocus
      • onKeyDown
      • onKeyUp
  • Built-Ins
    • Overview
    • wpda.log
    • wpda.alert
    • wpda.confirm
    • wpda.snackbar
  • Examples
    • Display specific columns in detail panel
    • Auto-reload table at specific intervals
    • Adding SEO links to table
    • Styling fields with setColumnStyle
    • Hide empty table column
    • Replicate data entered on field into another field

Layout & Styling

  • Fonts
  • Palette
  • Layout
  • Manual Styling (CSS)

Demos

  • Classic Models
  • Student Administration System
  • Data Table

Tutorials

  • Creating a Data Table App
  • Creating a Data Management App
View Categories

render

The render hook allows developers to implement custom renderers for specific table columns. This powerful hook enables rendering based on other column values or external data fetched via AJAX. It also supports built-in functions to change the text color and background color of other columns of the same rows.

Parameters #

  • columnName: column name of column being rendered
  • originalValue: column value as stored in the database
  • renderedValue: column value after default rendering
  • row: object containing the original values of all columns
row: {
	column_1: " - value column 1 - ",
	column_2: " - value column 2 - ",
	column_n: " - value column n - ",
}

Return value #

Template literal, DOM element or jQuery object

Additional built-in functions #

The following additional built-in functions are available in the render hook to change the color or background color of the current table row and cells belonging to the current table row.

  • setColor(color, columnName)
  • setBackgroundColor(color, columnName)
  • setRowColor(color)
  • setRowBackgroundColor(color)

Parameter columnName is optional. If omitted the column name of the rendered column is used.

Basic example of a column renderer representing the default behaviour #

((columnName, originalValue, renderedValue, row) => {
  return renderValue
})

A renderer may also include content and styles, for example, to add a Font Awesome icon #

((columnName, originalValue, renderedValue, row) => {
  return `<span>
    <i class="fa-solid fa-check"></i>
    ${renderedValue}
  </span>`
})

Accessing other column values for conditional rendering #

((columnName, originalValue, renderedValue, row) => {
  if (row.status === "check" && row.balance < 0) {
    return `<div style="color: red">
      <i class="fa-solid fa-check"></i>
      ${renderedValue}
    </div>`
  }

  return renderedValue
})

Example using multiple column references and built-in functions #

((columnName, originalValue, renderedValue, row) => {
  if (row.city === "Amsterdam") {
    // Change row color and background color
    setRowColor("white")
    setRowBackgroundColor("orange")

    // Change column color and background color
    setColor("blue")
    setBackgroundColor("yellow")

    // Change color and background color of column customerName
    setColor("black", "customerName")
    setBackgroundColor("white", "customerName")

    return `<strong>
      ${renderedValue}
    </strong>`
  } else {
    // Don't forget to reset the column color and background color
    // Row color and background color will reset automatically
    setColor("initial", "customerName")
    setBackgroundColor("initial", "customerName")

    return renderedValue
  }
})

Limitations and Notes #

  • Do not manipulate the DOM directly from a hook! WP Data Access is state-based, and all (re)rendering is performed through state changes. Manipulating the DOM from a hook might crash an app. Use built-in functions to change the app state or return an element that meets your requirements.
  • Column renderers are not available for computed fields, aggregations, inline editing, lookups, and WordPress media.
  • When built-in functions are used to overwrite color or background color in multiple places, the last assignment takes precedence.
  • It is not possible to change the color or background color of other rows.
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on 2025-03-12

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Parameters
  • Return value
  • Additional built-in functions
  • Limitations and Notes
WP Data Access
  • Follow
  • Follow
Quick Links
$

Blogs

$

Tutorials

$

Demos

Get in touch
$

Premium support

$

Free support forum

$

Contact us

Resources


WordPress plugin directory



YouTube tutorials

Copyright © 2025 | All Right Reserves

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok