0

在我给出的 struts2jquery 网格中

<sj:gridColumn name="processName" index="processName" title="Process Name" search="true" searchoptions="{sopt: ['bw','cn']}"/>

对于sopt,我们的值如下

{sopt:['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']}

现在我想通过忽略字母大小写来获取网格中的数据。但是,如果我们以与存储相同的方式进行搜索,它就会过滤数据。IE; (比如说)如果我存储以“D”开头的数据,它将不会过滤以“d”开头的数据。我该如何解决这个问题。有什么选择吗?

4

2 回答 2

0

这个链接应该可以帮助你struts2 jquery plugin wiki grid

您应该定义自己的搜索操作类来进行搜索。顺便说一句,应该是<sjg:gridColumn/>o_O

于 2012-06-26T14:19:03.797 回答
0

我用 JavaScript 找到了解决方案:

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<div id="prije">Prije</div>


<s:url var="remoteurl" action="jsontable" />

<sjg:grid id="gridtableID" 

    caption="Primjer JSON TABELE" 
    dataType="json"
    href="%{remoteurl}" 
    gridModel="gridModel" 
    viewrecords="true"
    pager="true"
    pagerPosition="centar"
    navigator="true"
    navigatorSearch="true"
    filter="true"
    filterOptions="{stringResult:true}"
    loadonce="true"

     >

    <sjg:gridColumn name="id"
        index="id" title="ID" 
        formatter="integer"
        search="false"
        searchoptions="{sopt:['cn','eq','ne','bw','bn','ew','en','nc']}"
        editable="false" />
    <sjg:gridColumn name="name" index="name" title="Name" sortable="true"
        search="true"
        searchoptions="{sopt:['cn','eq','ne','bw','bn','ew','en','nc']}" />
    <sjg:gridColumn name="country" index="country" title="Country"
        search="true"
        searchoptions="{sopt:['cn','eq','ne','bw','bn','ew','en','nc']}"/>
    <sjg:gridColumn name="city" index="city" title="City" search="true"
        searchoptions="{sopt:['cn','eq','ne','bw','bn','ew','en','nc']}" />
    <sjg:gridColumn name="creditLimit" index="creditLimit"
        title="Credit Limit" formatter="currency" search="true"
        searchoptions="{sopt:['cn','eq','ne','bw','bn','ew','en','nc']}"/>

</sjg:grid>

<script>
$(document).ready(function(){
    $("#gridtableID").jqGrid('setGridParam', { ignoreCase: true});
    });
</script>
于 2012-10-30T14:10:31.877 回答