<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: strut2 jquery plugin - grid table - 2 questions</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>ram2010 on strut2 jquery plugin - grid table - 2 questions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13896</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13896</guid>
        	        	<description><![CDATA[<p>Thanks that seemed to work fine. Thanks again. The dropdown list gets populated when I click on the column. Is there a way to ensure that its already pre-populated as the grid loads?</p>
</p>
<p>I think I figured out the answer to my 2nd question on the filtering. I noticed there is a parameter passed into the action called: _search. This wil be set to true when a filter is used for searching.</p>
</p>
<p>The &#39;index&#39; attribute set in the sj:gridColumn will contain the value the user enters in the filter.&#160;By having a getter method in the action class matching the value of index, you can then acertain the value.</p></p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 14:37:05 +0200</pubDate>
        </item>
        <item>
        	<title>jogep on strut2 jquery plugin - grid table - 2 questions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13890</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13890</guid>
        	        	<description><![CDATA[<p>To your first Question:</p>
</p>
<p>Create an Simple Struts2 Action like this:</p>
<p><code>public class CustomerCountrys extends ActionSupport {<br />&#160; private List&#60;String&#62;&#160;&#160;&#160;&#160;&#160; countrys;<br />&#160; private CustomersDao customersDao = new CustomersDao();</code></p>
<p>&#160; private static final long serialVersionUID = 6721064966173343669L;</p>
<p>&#160; @Action(value = "/customer-countrys", results = {<br />&#160;&#160;&#160; @Result(location = "customer-countrys.jsp", name = "success")<br />&#160; })<br />&#160; public String execute() throws Exception<br />&#160; {<br />&#160;&#160;&#160; countrys = customersDao.findCountrys();<br />&#160;&#160;&#160; return SUCCESS;<br />&#160; }<br />&#160; <br />&#160; public List&#60;String&#62; getCountrys()<br />&#160; {<br />&#160;&#160;&#160; return countrys;<br />&#160; }<br />}</p>
<p>Your <code>customer-countrys.jsp should be simple like this:</code></p>
<p>&#60;%@ taglib prefix="s" uri="/struts-tags"%&#62;<br />&#60;s:select list="countrys" theme="simple"/&#62;</p>
</p>
<p>Your gridColumn can look like this:</p>
<p>&#160;&#160;&#160; &#60;s:url id="selecturl" action="customer-countrys" /&#62; </p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#60;sj:gridColumn <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; name="country" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; index="country" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; title="Country" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortable="true" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editable="true" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; edittype="select" <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions="{ dataUrl : &#39;%{selecturl}&#39; }"<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; /&#62;</p>
<p>Hope this helps you.</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 12:41:52 +0200</pubDate>
        </item>
        <item>
        	<title>ram2010 on strut2 jquery plugin - grid table - 2 questions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13874</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/strut2-jquery-plugin-grid-table-2-questions#p13874</guid>
        	        	<description><![CDATA[<p>Hi, I am trying to implement jquery in particular to use the Edit Grid functionality. I am new to jquery&#160;&#38;&#160;the jquery plugin for struts.</p>
<p>I need some help with regards a couple of questions I have.</p>
</p>
<p>1) Select option(dropdown list) in a column &#38; pre-populating the data from a call to the server.</p>
<p>According to the jgrid wiki, to retrieve the details to be in the dropdown list, you specify a dataUrl.</p>
<p>Below is what I have been trying to do but withouth success.</p>
<p>editoptions="{dataUrl:/building/listAllAreas.action}"&#160;</p>
</p>
<p>my action I have in my struts.xml file as follows:</p>
<p>&#160;&#160;&#60;action name="listAllAreas" class="com.test.MyGridTableAction" method="findAllAreas"&#62;<br />&#160;&#160;&#160;&#160;&#160; &#60;result type="json" name="success"&#62;<br />&#160;&#160; &#160;&#160;&#160;&#60;param name="excludeProperties"&#62;service&#60;/param&#62;<br />&#160;&#160; &#160;&#160;&#60;/result&#62;<br />&#160;&#60;/action&#62;</p>
</p>
<p>I am unsure if what I am doing is the correct way to retrieve a list and put into a select box in a gridColumn. If anyone has any struts2 jquery examples, I would really appreciate it as it would help a lot.</p>
</p>
<p>2) When &#39;filter&#39; is set to true in sj:grid, it puts a row at the top of the table and all editable columns will have a textfield that can be used for searching. When values are entered in this filter textbox, it automatically makes a call to my action class. however at the moment I am unsure as to what variable I should be checking in my action class to retrieve the value entered by the user.</p>
<p>How do I check the value that is searched when using the filter option?&#160;</p>
<p>I added filter="true" in the struts2-jquery-showcase-1.8.1(Grid Editable section)&#160;to test this out, but It didnt seem to work. Nothing was being filtered.</p>
</p>
<p>Thanks in advance</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 23:29:22 +0200</pubDate>
        </item>
</channel>
</rss>