Angular UI Components Documentation
This tutorial makes jqxGrid editable: text, a drop-down list, a number input with validation, a date picker and a checkbox. The grid keeps the edited data; the component keeps a list of what changed in a signal, shows it, and hands it to a save method.

Use an Angular CLI app set up as in Angular CLI with jQWidgets, and read the section on inputs in Sorting, filtering and paging: recording a change updates a signal of the component, and the grid's inputs must not change when it does.
editable turns editing on. editmode: 'dblclick' starts an edit with a double click (the default is a click on a selected cell), and selectionmode: 'singlecell' selects cells rather than rows, which suits editing. Enter or a click elsewhere ends the edit; Esc cancels it.
<jqxGrid #grid
[theme]="'fluent'"
[width]="'100%'"
[autoheight]="true"
[source]="source"
[columns]="columns"
[editable]="true"
[editmode]="'dblclick'"
[selectionmode]="'singlecell'"
(onCellvaluechanged)="cellValueChanged($event)">
</jqxGrid>
A column's columntype picks its editor: dropdownlist, numberinput, datetimeinput, checkbox, or a text box by default. createeditor runs when the editor is created and receives the jQWidgets editor, so it can set the editor's own options, such as the list of departments. editable: false keeps a column read only.
Two callbacks check values:
validation receives the new value. Returning true accepts it; returning { result: false, message } keeps the editor open with the message under it, until the value is valid or the user cancels. The salary column uses it.cellvaluechanging runs when an edit ends, and the value it returns is stored. The name column trims the text, and returns the old value when the new one is empty, which cancels the change.export class App {
// …
readonly columns: jqwidgets.GridColumn[] = [
{
text: 'Name', datafield: 'name', width: 190,
// Runs when an edit ends; the value it returns is stored.
cellvaluechanging: (_row, _datafield, _columntype, oldvalue, newvalue) => {
// Returning the old value cancels the change.
return String(newvalue).trim() === '' ? oldvalue : String(newvalue).trim();
}
},
{
text: 'Department', datafield: 'department', width: 150, columntype: 'dropdownlist',
createeditor: (_row, _value, editor) => {
editor.jqxDropDownList({ source: departments, autoDropDownHeight: true });
}
},
{
text: 'Salary', datafield: 'salary', width: 130, columntype: 'numberinput', cellsformat: 'c0', cellsalign: 'right', align: 'right',
// The editor stays open, with the message under it, until the value is valid.
validation: (_cell, value) => {
if (value === undefined || value < 20000 || value > 300000) {
return { result: false, message: 'Enter a salary between 20,000 and 300,000.' };
}
return true;
},
createeditor: (_row, _value, editor) => {
editor.jqxNumberInput({ decimalDigits: 0, digits: 6, spinButtons: true });
}
},
{ text: 'Start date', datafield: 'startDate', width: 150, columntype: 'datetimeinput', cellsformat: 'yyyy-MM-dd' },
{ text: 'Remote', datafield: 'remote', columntype: 'checkbox', width: 80 },
// Read only: the id is not editable.
{ text: 'Id', datafield: 'id', width: 60, editable: false }
];
// …
}
The grid calls these functions itself. Written as arrow functions in a field, they can use the component's members through this, should they need to; a method passed as validation: this.check would run without the component as this.
The grid raises cellvaluechanged after each accepted edit, and the template listens with (onCellvaluechanged). Its details are in event.args: the row index, the field, and the old and new values. The handler adds them to the changes signal. It does not put the edited rows back into the grid's source: the grid already shows them, and the grid's inputs stay as they are, so the grid is not bound again.
export class App {
// …
// Each accepted edit, added to the list. The grid's inputs do not change, so the grid
// is not bound again and keeps the edited value.
cellValueChanged(event: CellValueChangedEvent): void {
const { args } = event;
const id = Number(this.grid().getrowid(args.rowindex));
this.changes.update((current) => [...current, { id, field: args.datafield, oldValue: args.oldvalue, newValue: args.newvalue }]);
}
// …
}
<h2>Unsaved changes: {{ changes().length }}</h2>
<ul>
@for (change of changes(); track $index) {
<li>Employee {{ change.id }}: {{ change.field }} {{ change.oldValue }} → {{ change.newValue }}</li>
}
</ul>
<button type="button" (click)="save()" [disabled]="changes().length === 0">Save changes</button>
To save, getrows() returns the grid's current rows, edits included. The example sends only the rows that changed, and empties the list once they are saved.
export class App {
// …
save(): void {
const changedIds = new Set(this.changes().map((c) => c.id));
const payload = this.grid()
.getrows()
.filter((row) => changedIds.has(row.id));
// Send payload to your server here, for example with HttpClient's put().
console.log('Saving', payload);
this.changes.set([]);
}
}
A name changed to an empty text raises no cellvaluechanged: cellvaluechanging put the old value back, so nothing changed.
src/app/app.ts:
import { Component, signal, viewChild } from '@angular/core';
import { jqxGridComponent, jqxGridModule } from 'jqwidgets-ng/jqxgrid';
interface Employee {
id: number;
name: string;
department: string;
salary: number;
startDate: Date;
remote: boolean;
}
interface Change {
id: number;
field: string;
oldValue: unknown;
newValue: unknown;
}
// A grid event carries its details in event.args.
interface CellValueChangedEvent {
args: { rowindex: number; datafield: string; oldvalue: unknown; newvalue: unknown };
}
const departments = ['Engineering', 'Finance', 'Marketing', 'Sales', 'Support'];
const employees: Employee[] = [
{
id: 1,
name: 'Nancy Davolio',
department: 'Sales',
salary: 58000,
startDate: new Date(2026, 0, 12),
remote: false
},
{
id: 2,
name: 'Andrew Fuller',
department: 'Sales',
salary: 92000,
startDate: new Date(2026, 1, 2),
remote: true
},
{
id: 3,
name: 'Janet Leverling',
department: 'Marketing',
salary: 61000,
startDate: new Date(2026, 2, 16),
remote: true
},
{
id: 4,
name: 'Margaret Peacock',
department: 'Finance',
salary: 67000,
startDate: new Date(2026, 4, 4),
remote: false
},
{
id: 5,
name: 'Steven Buchanan',
department: 'Engineering',
salary: 88000,
startDate: new Date(2026, 6, 1),
remote: true
},
{
id: 6,
name: 'Michael Suyama',
department: 'Support',
salary: 49000,
startDate: new Date(2026, 8, 14),
remote: false
}
];
@Component({ selector: 'app-root', imports: [jqxGridModule], templateUrl: './app.html' })
export class App {
readonly grid = viewChild.required<jqxGridComponent>('grid');
// What changed since the last save. The grid itself keeps the edited data.
readonly changes = signal<Change[]>([]);
readonly source = new jqx.dataAdapter({
localdata: employees,
datatype: 'array',
id: 'id',
datafields: [
{ name: 'id', type: 'number' },
{ name: 'name', type: 'string' },
{ name: 'department', type: 'string' },
{ name: 'salary', type: 'number' },
{ name: 'startDate', type: 'date' },
{ name: 'remote', type: 'bool' }
]
});
readonly columns: jqwidgets.GridColumn[] = [
{
text: 'Name',
datafield: 'name',
width: 190,
// Runs when an edit ends; the value it returns is stored.
cellvaluechanging: (_row, _datafield, _columntype, oldvalue, newvalue) => {
// Returning the old value cancels the change.
return String(newvalue).trim() === '' ? oldvalue : String(newvalue).trim();
}
},
{
text: 'Department',
datafield: 'department',
width: 150,
columntype: 'dropdownlist',
createeditor: (_row, _value, editor) => {
editor.jqxDropDownList({ source: departments, autoDropDownHeight: true });
}
},
{
text: 'Salary',
datafield: 'salary',
width: 130,
columntype: 'numberinput',
cellsformat: 'c0',
cellsalign: 'right',
align: 'right',
// The editor stays open, with the message under it, until the value is valid.
validation: (_cell, value) => {
if (value === undefined || value < 20000 || value > 300000) {
return { result: false, message: 'Enter a salary between 20,000 and 300,000.' };
}
return true;
},
createeditor: (_row, _value, editor) => {
editor.jqxNumberInput({ decimalDigits: 0, digits: 6, spinButtons: true });
}
},
{
text: 'Start date',
datafield: 'startDate',
width: 150,
columntype: 'datetimeinput',
cellsformat: 'yyyy-MM-dd'
},
{ text: 'Remote', datafield: 'remote', columntype: 'checkbox', width: 80 },
// Read only: the id is not editable.
{ text: 'Id', datafield: 'id', width: 60, editable: false }
];
// Each accepted edit, added to the list. The grid's inputs do not change, so the grid
// is not bound again and keeps the edited value.
cellValueChanged(event: CellValueChangedEvent): void {
const { args } = event;
const id = Number(this.grid().getrowid(args.rowindex));
this.changes.update((current) => [
...current,
{ id, field: args.datafield, oldValue: args.oldvalue, newValue: args.newvalue }
]);
}
save(): void {
const changedIds = new Set(this.changes().map((c) => c.id));
const payload = this.grid()
.getrows()
.filter((row) => changedIds.has(row.id));
// Send payload to your server here, for example with HttpClient's put().
console.log('Saving', payload);
this.changes.set([]);
}
}
src/app/app.html:
<h1>Employees</h1>
<p>Double-click a cell to edit it. Enter or a click outside saves the cell; Esc cancels.</p>
<jqxGrid #grid
[theme]="'fluent'"
[width]="'100%'"
[autoheight]="true"
[source]="source"
[columns]="columns"
[editable]="true"
[editmode]="'dblclick'"
[selectionmode]="'singlecell'"
(onCellvaluechanged)="cellValueChanged($event)">
</jqxGrid>
<h2>Unsaved changes: {{ changes().length }}</h2>
<ul>
@for (change of changes(); track $index) {
<li>Employee {{ change.id }}: {{ change.field }} {{ change.oldValue }} → {{ change.newValue }}</li>
}
</ul>
<button type="button" (click)="save()" [disabled]="changes().length === 0">Save changes</button>
Double-click Nancy Davolio's salary and type 5: the message Enter a salary between 20,000 and 300,000. appears and the editor stays open. Type 61000 and press Enter: the cell shows $61,000 and the list reads Employee 1: salary 58000 → 61000. Save changes logs the changed rows and empties the list.
columns)