问题描述
你能告诉我有关下面(some-widget),例如:
Can you tell me the list of valid values for the widget constraint below (some-widget), e.g.:
static constraints = {
someField(widget: 'some-widget')
}
文档似乎已丢失。相关的,你知道任何可以直接使用这个约束的插件么?
The documentation seems to be missing. Related, do you know of any plugins that can work directly with this constraint?
推荐答案
据我所知, widget
属性仅用于脚手架,并在。在那个文件中,看起来这个widget属性有一些非常狭窄的用途,这取决于你脚手架的对象类型。
From what I can tell, the widget
property is only used for scaffolding and is referenced in the renderEditor.template. In that file, it appears that the widget property has some pretty narrow uses depending on the type of object you are scaffolding.
好消息是,你可以请提供您自己的 renderEditor.template
文件,然后根据需要对其进行编辑。只需在 $ {basedir} /src/templates/scaffolding/renderEditor.template
中创建一个文件,当您生成视图时,Grails将会选择它。
The good news, however, is that you can supply your own renderEditor.template
file and edit it to work however you want. Just create a file at ${basedir}/src/templates/scaffolding/renderEditor.template
and Grails will pick it up when you generate the views.
(请参阅获取更多信息。)
(See DefaultGrailsTemplateGenerator for more information.)
这篇关于哪些小部件约束对Grails域类有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!