Skip to content

Commit 6bdea65

Browse files
committed
fix: skip Attribute fallback for custom-content datagrid columns
PR #202 added a sugar that falls back to the column's name when no explicit Attribute is given. For custom-content columns (those with an action-button body and no attribute binding), this caused CE1613 "attribute no longer exists" because names like 'colActions' don't resolve to real attributes. Skip the sugar when the column has child widgets — those columns don't bind to an attribute. Fixes the 03-page-examples.mdl integration test regression.
1 parent 52f41dc commit 6bdea65

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

mdl/executor/cmd_pages_builder_v3_widgets.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ func (pb *pageBuilder) buildDataGridV3(w *ast.WidgetV3) (*pages.CustomWidget, er
128128
attr := child.GetAttribute()
129129
// Sugar: when no explicit Attribute: property is given, fall back to
130130
// the column's name. This lets `COLUMN Sku (Caption: 'SKU')` work
131-
// without repeating `Attribute: Sku`. If the name starts with a
132-
// lowercase prefix like "col" (convention for decoration), it won't
133-
// resolve to a real attribute — and mx check will flag it later.
134-
if attr == "" && child.Name != "" {
131+
// without repeating `Attribute: Sku`. Skip for custom-content columns
132+
// (those with a body of child widgets), which don't bind to an attribute.
133+
if attr == "" && child.Name != "" && len(child.Children) == 0 {
135134
attr = child.Name
136135
}
137136
col := ast.DataGridColumnDef{

0 commit comments

Comments
 (0)