2012-10-23 2 views
1

Struts2 jquery 그리드에 대한 필터 검색을 구현하려고합니다. jquery 필터 텍스트 상자를 통해 문자열을 검색하면 내 액션 클래스를 호출하지만 내 액션 클래스에서 검색 문자열을 가져올 수 없습니다. Action 클래스 내에이 줄을 인쇄하려고했지만 검색 문자열이 내 Action 클래스에 나타나지 않습니다.필터 구현 방법 Struts2 Jquery Plugin을 사용한 검색

System.out.println("This line is getting printed But search textbox values is not printing."+searchString+""+searchField); 

이 저를 도와주세요, 내가 많이 시도하고, 여전히 내 코드 .. 그것을 위해 노력하고 있습니다 :

Subjectinfo.jsp

  <%@ page contentType="text/html; charset=UTF-8"%> 
      <%@ taglib prefix="s" uri="/struts-tags"%> 
      <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 
      <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%> 
      <html> 
      <head> 
      <title>Hello World</title> 
      <style type="text/css"> 
      @import 
      url(<%=request.getContextPath()%>/css/style1.css); 
      </style> 
      <sj:head jqueryui="true" jquerytheme="le-frog"/> 
      </head> 
      <body> 
       <div id="setpage"> <s:url id="editurl" action="nedit"/> 
        <s:url id="editurl" action="nedit"/> 
        <s:url id="remoteurl" action="ntable"/> 

        <sjg:grid 
         id="gridtable" 
         caption="Customer Examples" 
         dataType="json" 
         filter="true" 
         filterOptions="{ stringResult :true, 
         searchOnEnter : false, 
         enableClear : true, 


         gridModel="gridModel" 
         rowList="10,15,20" 
         navigatorDelete="true"> 
        <sjg:gridColumn name="id" index="subjectId" title="ID" formatter="integer" sortable="true" key="true" 
             search="true" searchoptions="{sopt:['eq']}" editable="true" hidden="true" /> 

        <sjg:gridColumn name="subjectName" index="subjectName" title="Subject Name" sortable="true" search="true" 
             editable="true" 
             edittype="text" /> 
        </sjg:grid> 

        </div> 
      </body> 
      </html> 

답변

0

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:toolbar_searching

에서

stringResult 옵션을 true로 설정하면 서버에 게시 된 데이터가 문자열이고 게시 된 데이터는 고급 검색의 데이터와 동일합니다.

http://www.trirand.com/jqgridwiki/doku.php?id=wiki:advanced_searching#options

그래서 나는 당신의 문제는 당신이되는 searchString을 찾고 있지만,있는 jqGrid가 고급 검색 옵션 링크에 설명 된대로 JSON 문자열입니다 필터라는 요청 변수를 전송하고 있음을 생각합니다.