Merge pull request #31371 from Z4nzu/grid_page_length_feature

feat: Add Grid Page Length field for child tables in DocType
This commit is contained in:
Ejaaz Khan 2025-02-21 13:08:33 +05:30 committed by GitHub
commit dc01badc3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View file

@ -31,6 +31,7 @@
"is_calendar_and_gantt",
"editable_grid",
"quick_entry",
"grid_page_length",
"cb01",
"track_changes",
"track_seen",
@ -680,6 +681,14 @@
"hidden": 1,
"label": "Row Format",
"options": "Dynamic\nCompressed"
},
{
"default": "50",
"depends_on": "istable",
"fieldname": "grid_page_length",
"fieldtype": "Int",
"label": "Grid Page Length",
"non_negative": 1
}
],
"icon": "fa fa-bolt",
@ -799,4 +808,4 @@
"states": [],
"track_changes": 1,
"translated_doctype": 1
}
}

View file

@ -121,6 +121,7 @@ class DocType(Document):
engine: DF.Literal["InnoDB", "MyISAM"]
fields: DF.Table[DocField]
force_re_route_to_default_view: DF.Check
grid_page_length: DF.Int
has_web_view: DF.Check
hide_toolbar: DF.Check
icon: DF.Data | None

View file

@ -5,7 +5,7 @@ export default class GridPagination {
}
setup_pagination() {
this.page_length = 50;
this.page_length = this.grid.meta?.grid_page_length || 50;
this.page_index = 1;
this.total_pages = Math.ceil(this.grid.data.length / this.page_length);