我有一个表,和三个不同的(打开,关闭,待处理),当用户通过客户端筛选时,请参见相应的值。
但是,当用户从以下示例更改为:打开到关闭表丢失了过滤器时,是否有一种方法可以尊重gsp View 之间的过滤器?
最佳答案
确保在g:select上设置了value =(请参见以下代码),并且页面应记住该设置。
<div class="form-group ${hasErrors(bean: searchCommand, field: 'testTypeId', 'has-error')}">
<label for="testType">
Test Type
</label>
<g:select id="testType" name="testTypeId" from="${TestType.findAllByActive(true).sort({it.sortOrder})}" optionKey="id"
value="${searchCommand?.testTypeId}" noSelection="['':'-Choose One-']" class="form-control"/>
</div>
关于grails - 尊重过滤网,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40428959/