2012-06-26 144 views
0

在我struts2jquery网格我已经给SOPT值忽略大小写

<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']}

值现在,我想在网格中的数据通过无视信件的情况。但是,如果我们以我们存储的相同方式进行搜索,它将过滤数据。即; (说)如果我以'D'开始存储数据,它将不会过滤以'd'开头的数据。我该如何解决这个问题。有没有这样做的选择?

回答

0

此链接应该帮助你struts2 jquery plugin wiki grid

您应该定义您自己的搜索操作类来执行搜索。顺便说一句,它应该是​​ O_O

+0

噢,对不起,它的,当我进入这里的一些错误来了。谢谢! – Deepu

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>