【问题标题】:Respect Filter Grails尊重过滤器Grails
【发布时间】:2016-11-04 17:52:21
【问题描述】:

我有一个表,三个不同的(Open, Close, Pending),当用户按客户端过滤时,看到对应的值。

但是当用户从示例中更改:打开到关闭表丢失了过滤器,有没有办法尊重gsp视图之间的过滤器?

【问题讨论】:

    标签: grails gsp


    【解决方案1】:

    确保您在 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-26
      相关资源
      最近更新 更多