Struts2 jQGrid插件案例不敏感的工具栏搜索

时间:2020-11-27 14:29:25

I find this two topics very useful:

我发现这两个主题非常有用:

(first: Case insensitive search in jqGrid including hidden fields),
(second: Search in the middle of a column by default in jqGrid with toolbar search),

(第一个:jqGrid中包含隐藏字段的不区分大小写搜索),(第二个:默认情况下在jqGrid中使用工具栏搜索在列中间搜索),

How to apply this in JSP?

如何在JSP中应用它?

1 个解决方案

#1


0  

i fount the solution: This is the response JSP:

我找到了解决方案:这是响应JSP:

<%@ 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>

#1


0  

i fount the solution: This is the response JSP:

我找到了解决方案:这是响应JSP:

<%@ 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>