-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve rowEditor buttons on DataTable with editMode="row" #1788
Comments
Now users can create special button elements according to their needs with the parameters given in the body function. Exp;
Best Regards, |
thanks a lot! |
I am getting rowEditor null, can someone help me please. |
Hi @shiddugmail, I couldn't replicate it. Could you please create a new issue about it? And could you please attach a sample codesandbox for us to replicate? |
Hello @mertsincan And it worked. |
Glad to hear, thanks a lot for your update! Best Regards, |
for someone this may help, this is how I render custom UI for row editor: <Column
rowEditor
header={t('common:actions')}
body={(rowData: any, options: ColumnBodyOptions) => (
<>
{options.rowEditor?.editing ? (
<>
<Button
icon="pi pi-save"
className="p-button-rounded mr-2 p-button-outlined"
onClick={(e) =>
options.rowEditor?.onSaveClick &&
options.rowEditor?.onSaveClick(e)
}
tooltip={t("common:save")}
tooltipOptions={{ position: "top" }}
/>
<Button
icon="pi pi-times"
className="p-button-rounded p-button-outlined"
onClick={(e) =>
options.rowEditor?.onCancelClick &&
options.rowEditor?.onCancelClick(e)
}
tooltip={t("common:cancel")}
tooltipOptions={{ position: "top" }}
severity="warning"
/>
</>
) : (
<>
<Button
icon="pi pi-pencil"
className="p-button-rounded mr-2 p-button-outlined"
onClick={(e) =>
options.rowEditor?.onInitClick &&
options.rowEditor?.onInitClick(e)
}
tooltip={t("common:edit")}
tooltipOptions={{ position: "top" }}
severity="success"
/>
<Button
icon="pi pi-trash"
className="p-button-rounded p-button-outlined"
tooltip={t("common:delete")}
tooltipOptions={{ position: "top" }}
severity="danger"
onClick={() =>
confirmDialog({
message: "Are you sure you want to delete?",
header: "Confirmation",
icon: "pi pi-exclamation-triangle",
accept: () => handleDelete(rowData.id),
})
}
/>
</>
)}
</>
)}
></Column> |
There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours
I'm submitting a ... (check one with "x")
Current behavior
Now you can add a bodyAction and modify the buttons as you want, but if you want do the same with the buttons provided from rowEdit function, you can't
Expected behavior
Add a property to change buttons format, add tooltip and this stuff
The text was updated successfully, but these errors were encountered: