【问题标题】:Struts2 jqGrid Remove x On Individual Column FiltersStruts2 jqGrid 删除单个列过滤器上的 x
【发布时间】:2015-09-01 08:32:44
【问题描述】:

我有一个带有列过滤器的网格的 struts2-jquery jqGrid 页面。一些列是日期格式,我不希望显示,因此我使用 .hide() 删除了该列过滤器的输入字段。

$("#gs_fraudEndDt").hide();

但是,我刚刚隐藏的字段旁边还有一个小“x”。下面是显示列字段的 html。

<th class="ui-state-default ui-th-column ui-th-ltr" role="columnheader">
  <div style="position:relative;height:100%;padding-right:0.3em;padding-left:0.3em;">
     <table class="ui-search-table" cellspacing="0">
     <tbody>
       <tr>
          <td class="ui-search-oper" colindex="8" style="display: none;"></td>
          <td class="ui-search-input">
             <input id="gs_fraudEndDt" type="text" value="" name="fraudEndDt" style="width: 100%; padding: 0px; display: none;" disabled="">
          </td>
          <td class="ui-search-clear">
             <a class="clearsearchclass" style="padding-right: 0.3em;padding-left: 0.3em;" title="Clear Search Value">x</a>
          </td>
        </tr>
     </tbody>
  </table>

有多个 td 标记,其中 class="clearsearchclass" 所以我需要包括选择 colindex=8(从 td 标记向上几行)来指定此特定列。

我需要使用什么选择器来获取这个特定的 td 标记?或者有没有更好的方法来隐藏单个过滤器和“x”?

感谢您的帮助

【问题讨论】:

    标签: jquery jqgrid struts2-jquery struts2-jquery-grid


    【解决方案1】:

    可以在colModel 中为特定列指定searchoptions: {clearSearch: false}。它会从相应列的过滤器栏中删除x 按钮。我想您应该像 &lt;sjg:gridColumn&gt; 中的任何其他搜索选项一样指定该选项(请参阅 the documentation)。

    【讨论】:

    • 做到了! searchoptions="{clearSearch: false}"再次感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 2012-10-06
    • 2013-05-29
    • 1970-01-01
    • 2014-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-01
    相关资源
    最近更新 更多