DataTable Row Editing onRowEditValidator Not Working
Posted: 12 Nov 2021, 16:35
The DataTable row editing onRowEditValidator does not appear to be working (https://www.primefaces.org/primereact/s ... /datatable). Version 7.0.0. I have copied the code exactly, tried throwing a console.log in the function just to see if I hit it, and nothing happens. How does the validation occur? Is it supposed to prevent submission of the row? Any assistance is appreciated, thank you!
Code: Select all
<DataTable value={products} editMode="row">
<Column field="code" header="Code" />
<Column field="name" header="Name" />
<Column field="inventoryStatuses" header="Status" editor={statusEditor} onRowEditValidator={onRowEditValidator} />
<Column rowEditor />
</DataTable>
Code: Select all
const onRowEditValidator = (rowData) => {
let value = rowData['inventoryStatuses'];
return value.length > 0;
}