GRAILS集成EXTJS的Scaffolding实现

阅读更多
功能:根据Domain定义自动生成CRUD

效果图:
GRAILS集成EXTJS的Scaffolding实现_第1张图片
代码:
<% import grails.persistence.Event %><% import org.codehaus.groovy.grails.plugins.PluginManagerHolder %><%=packageName%>
<% boolean hasHibernate = PluginManagerHolder.pluginManager.hasGrailsPlugin('hibernate') %><%
    def output(p,cp)
    {
        if (p.type == String.class) {
            out << ",xtype: 'textfield'"
            if (cp.blank == false) {
                out << ", allowBlank: false, blankText: '\${cgDomainProperties.${p.name}.chinese}为必填项'" //,msgTarget: 'side'"
            }
            if (cp.maxSize != null) {
                out << ", maxLength: ${cp.maxSize}, maxLengthText: '\${cgDomainProperties.${p.name}.chinese}至多包含${cp.maxSize}个字符'"
            }
            if (cp.minSize != null) {
                out << ", minLength: ${cp.minSize}, minLengthText: '\${cgDomainProperties.${p.name}.chinese}至少包含${cp.minSize}个字符'"
            }
        } else if (p.type == Date.class) {
            out << "'datefield',format:'Y-m-d'"
        }
    }
%>

    
        
        
        
        <g:message code="\${entityName}管理" />
    
    
    
        
  • GRAILS集成EXTJS的Scaffolding实现_第2张图片
  • 大小: 48 KB
  • 查看图片附件

你可能感兴趣的:(Grails,EXT,Groovy,ITeye,Hibernate)