From 0437b3b2ceb536a22e58372fb638f8fed521173b Mon Sep 17 00:00:00 2001 From: zain2983 Date: Mon, 2 Feb 2026 02:04:19 +0500 Subject: [PATCH] fix(data_table): resolve blank cells for non-camelCase column keys (#6108) --- reflex/components/gridjs/datatable.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index 86a087f555f..da1966761c9 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -127,5 +127,14 @@ def _render(self) -> Tag: self.columns = LiteralVar.create(data["columns"]) self.data = LiteralVar.create(data["data"]) + # If columns is a list of strings convert to list of dicts with id and name keys + if isinstance(self.columns, LiteralVar) and isinstance( + self.columns._var_value, list + ): + self.columns = LiteralVar.create([ + {"id": col, "name": col} if isinstance(col, str) else col + for col in self.columns._var_value + ]) + # Render the table. return super()._render()