diff --git a/widgets/table/layout.go b/widgets/table/layout.go index 289fee5b..b20e73eb 100644 --- a/widgets/table/layout.go +++ b/widgets/table/layout.go @@ -53,12 +53,15 @@ func (layout *LayoutDSL) BindModel(m *gou.Model, fields *FieldsDSL, option map[s Props: component.PropsDSL{}, Columns: component.Instances{}, Operation: OperationTableDSL{ + Hide: true, Fold: false, Actions: component.Actions{}, }, } if hasForm { + layout.Table.Operation.Width = 160 + layout.Table.Operation.Hide = false layout.Table.Operation.Actions = append( layout.Table.Operation.Actions, @@ -104,7 +107,8 @@ func (layout *LayoutDSL) BindModel(m *gou.Model, fields *FieldsDSL, option map[s if ok && name != "deleted_at" { if col, has := fields.tableMap[name]; has { layout.Table.Columns = append(layout.Table.Columns, component.InstanceDSL{ - Name: col.Key, + Name: col.Key, + Width: 160, }) } } diff --git a/widgets/table/types.go b/widgets/table/types.go index e67699a8..80af013a 100644 --- a/widgets/table/types.go +++ b/widgets/table/types.go @@ -125,7 +125,9 @@ type ViewLayoutDSL struct { // OperationTableDSL layout.table.operation type OperationTableDSL struct { + Width int `json:"width,omitempty"` Fold bool `json:"fold,omitempty"` + Hide bool `json:"hide,omitempty"` Actions component.Actions `json:"actions"` }