diff --git a/widgets/list/bind.go b/widgets/list/bind.go index 09d02223..c757b510 100644 --- a/widgets/list/bind.go +++ b/widgets/list/bind.go @@ -10,23 +10,27 @@ import ( // Bind model / store / table / ... func (dsl *DSL) Bind() error { - if dsl.Action.Bind == nil { - return nil - } - - if dsl.Action.Bind.Model != "" { - return dsl.bindModel() - } - - if dsl.Action.Bind.Store != "" { - return dsl.bindStore() - } - - if dsl.Action.Bind.Table != "" { - return dsl.bindTable() - } + // Support bind in future version return nil + + // if dsl.Action.Bind == nil { + // return nil + // } + + // if dsl.Action.Bind.Model != "" { + // return dsl.bindModel() + // } + + // if dsl.Action.Bind.Store != "" { + // return dsl.bindStore() + // } + + // if dsl.Action.Bind.Table != "" { + // return dsl.bindTable() + // } + + // return nil } func (dsl *DSL) bindModel() error { diff --git a/widgets/list/handler.go b/widgets/list/handler.go index 608c5043..13e83c1f 100644 --- a/widgets/list/handler.go +++ b/widgets/list/handler.go @@ -104,13 +104,15 @@ func (dsl *DSL) translate(name string, process *gouProcess.Process, data interfa } widgets := []string{} - if dsl.Action.Bind.Model != "" { - m := model.Select(dsl.Action.Bind.Model) - widgets = append(widgets, fmt.Sprintf("model.%s", m.ID)) - } + if dsl.Action.Bind != nil { + if dsl.Action.Bind.Model != "" { + m := model.Select(dsl.Action.Bind.Model) + widgets = append(widgets, fmt.Sprintf("model.%s", m.ID)) + } - if dsl.Action.Bind.Table != "" { - widgets = append(widgets, fmt.Sprintf("table.%s", dsl.Action.Bind.Table)) + if dsl.Action.Bind.Table != "" { + widgets = append(widgets, fmt.Sprintf("table.%s", dsl.Action.Bind.Table)) + } } widgets = append(widgets, fmt.Sprintf("list.%s", dsl.ID))