We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我在formlist中尝试addtable(...,...,func(pa *types.FormPanel) {}),对于pa这个表单addfield custom类型,在按照官方文档可以在CustomContent中,使用这样的模板语法来表示编辑时字段的值:{{.Value}} 但实际并没有解析{{.Value}}
formList.AddTable("场景内容", "context", func(pa *types.FormPanel) { pa.AddField("场景第一句话文案", "greet_text", db.Text, form.Custom).FieldMust().FieldHideLabel(). FieldCustomContent(template.HTML(<input type="button" onclick="showPopup()" value="显示"> <input required="1" type="text" name="greet_text" value="{{.Value}}" class="form-control greet_text" placeholder="输入 场景第一句话文案">)). FieldDisplay(func(value types.FieldModel) interface{} { if _, ok := value.Row["bot_id"]; !ok { return []string{""} } else { contextFirstTexts := []string{} for _, item := range botContextAllRecords { if item.Status == "UP" { decData := utils.DecodeBase64(ctx, item.GreetText) if decData == "" { logger.WarnCtx(ctx, "error decoding") } contextFirstTexts = append(contextFirstTexts, decData) } } if len(contextFirstTexts) == 0 { return []string{""} } return contextFirstTexts } }) }).FieldInputWidth(20).FieldMust()
<input type="button" onclick="showPopup()" value="显示"> <input required="1" type="text" name="greet_text" value="{{.Value}}" class="form-control greet_text" placeholder="输入 场景第一句话文案">
显示数据库中正确的信息而不是未解析的Value
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Description [describe the bug in detail]
我在formlist中尝试addtable(...,...,func(pa *types.FormPanel) {}),对于pa这个表单addfield custom类型,在按照官方文档可以在CustomContent中,使用这样的模板语法来表示编辑时字段的值:{{.Value}}
但实际并没有解析{{.Value}}
How to reproduce [describe the steps how to reproduce the bug]
formList.AddTable("场景内容", "context", func(pa *types.FormPanel) {
pa.AddField("场景第一句话文案", "greet_text", db.Text, form.Custom).FieldMust().FieldHideLabel().
FieldCustomContent(template.HTML(
<input type="button" onclick="showPopup()" value="显示"> <input required="1" type="text" name="greet_text" value="{{.Value}}" class="form-control greet_text" placeholder="输入 场景第一句话文案">
)).FieldDisplay(func(value types.FieldModel) interface{} {
if _, ok := value.Row["bot_id"]; !ok {
return []string{""}
} else {
contextFirstTexts := []string{}
for _, item := range botContextAllRecords {
if item.Status == "UP" {
decData := utils.DecodeBase64(ctx, item.GreetText)
if decData == "" {
logger.WarnCtx(ctx, "error decoding")
}
contextFirstTexts = append(contextFirstTexts, decData)
}
}
if len(contextFirstTexts) == 0 {
return []string{""}
}
return contextFirstTexts
}
})
}).FieldInputWidth(20).FieldMust()
Expect [describe your expect result]
显示数据库中正确的信息而不是未解析的Value
Reproduction code [here to show your codes or examples]
Versions
版本 128.0.2739.67 (正式版本) (64 位)
Others [screenshots or others info here]
The text was updated successfully, but these errors were encountered: