如何在grails

时间:2015-12-29 06:45:09

标签: gorm grails-2.0

这是我的gsp页面



<html>
<head>
  <title>GORM APP</title>
</head>
<body>
<table border="2px">	
	<tr>
	<td>EMPLOYEE ID</td>
	<td>EMPLOYEE NAME</td>
	</tr>
	 <g:each in="${table}" var="x">
	<tr>
	<td>${x.emp_id}</td>
	<td>${x.emp_name}</td>
	</tr>
	</g:each>
	</table>
</body>
</html>
&#13;
&#13;
&#13;

我很喜欢groovy grails.Iam尝试创建员工管理应用程序 我尝试

1 个答案:

答案 0 :(得分:0)

enter code here
<table>
            <thead>
                    <tr>

                        <g:sortableColumn property="employeId" title="EMPLOYEE ID" />

                        <g:sortableColumn property="name" title="EMPLOYEE NAME" />

                    </tr>
                </thead>
                <tbody>
                <g:each in="${employeInstanceList}" status="i" var="employeInstance">
                    <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">


                        <td>${fieldValue(bean: employeInstance, field: "employeId")}</td>

                        <td>${fieldValue(bean: employeInstance, field: "name")}</td>

                    </tr>
                </g:each>
                </tbody>
            </table>`