Merge pull request #36189 from UmakanthKaspa/fix-duplicate-row-btn

fix(grid): hide duplicate row button when cannot_add_rows is true
This commit is contained in:
Ejaaz Khan 2026-01-22 17:41:47 +05:30 committed by GitHub
commit fc06d5ac24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -351,7 +351,10 @@ export default class Grid {
? false
: true;
this.remove_rows_button.toggleClass("hidden", show_buttons);
this.duplicate_rows_button.toggleClass("hidden", show_buttons);
this.duplicate_rows_button.toggleClass(
"hidden",
show_buttons || this.cannot_add_rows || (this.df && this.df.cannot_add_rows)
);
let select_all_checkbox_checked = this.wrapper.find(
".grid-heading-row .grid-row-check:checked:first"
@ -371,7 +374,7 @@ export default class Grid {
);
refresh_duplicate_rows_button() {
if (this.df.cannot_add_rows) {
if (this.df.cannot_add_rows || (this.df && this.df.cannot_add_rows)) {
return;
}