DataTable Row Editing onRowEditValidator Not Working

UI Components for React
Post Reply
RomanEmpirical
Posts: 1
Joined: 12 Nov 2021, 16:12

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;
}

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests