DataRow packet

A DataRow packet is sent by the server to the client for each row in a result set. It contains the values for each column of the row, which can be accessed by name (case-sensitive) or by column number (0-based):

if (context.packet.customer_name === 'Jones') ...

if (context.packet["customer_name"] === "Jones") ...

if (context.packet[3] === "Jones") ...

Attributes

Methods

Examples

Changing a value in a row:

if (context.packet.country === 'DK') {

    context.packet.salary = 0;

}


Changing a value based on metadata in a result set filter:

if (context.packet.rowDescription.getFieldByName("salary") != null) {
    context.packet.salary = 0.0;
}


Hiding rows that have certain criteria:

if (context.packet.userName === 'aenewman' && context.packet.state !== 'MN') {
    context.packet.remove();
}