<?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: how to assoicate parent checkox to subgrid checkbox</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox</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/how-to-assoicate-parent-checkox-to-subgrid-checkbox/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>yenkumar on how to assoicate parent checkox to subgrid checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13819</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13819</guid>
        	        	<description><![CDATA[<blockquote>
</blockquote>
<blockquote>
<p>tony said:</p>
<p>Hello,</p>
<p>If you know the id&#39;s of both grids you can attach a onclick event to every check box and perform the needed actions</p>
<p>Regards</p>
<p>Tony</p>
</blockquote>
<hr />
<p>Hi Tony,</p>
<p>&#160;&#160; This is the way i have resolved the issues.....</p>
<p>&#160;&#160; Parent ID : chkPO_&#60;PONumber&#62; as per the application.</p>
<p>&#160;&#160; Child ID : chkPOItems_&#60;PONumber&#62;</p>
<p>&#160;&#160;&#160; &#60;!--&#160;&#160; Use JQuery wildcard selector to find all checkboxes which start with poItemId --&#62;<br />&#160;&#160;&#160; function togglePOItemsCheckbox(parent) {<br />&#160;&#160;&#160; var poItemId = &#39;chkPOItems_&#39; + parent.id.substr(parent.id.indexOf(&#39;_&#39;) + 1) + &#39;_&#39;;<br />&#160;&#160;&#160; $(&#39;[id^=&#39; + poItemId + &#39;]input:checkbox&#39;).attr(&#39;checked&#39;, parent.checked);<br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; function togglePOCheckbox(child) {<br />&#160;&#160;&#160; var po = child.id.substring(child.id.indexOf(&#39;_&#39;) + 1, child.id.lastIndexOf(&#39;_&#39;));</p>
<p>&#160;&#160;&#160; // Check if any of the child checkboxes are checked<br />&#160;&#160;&#160; var isChecked = $(&#39;[id^=chkPOItems_&#39; + po + &#39;]input:checkbox&#39;).is(":checked");</p>
<p>&#160;&#160;&#160; $(&#39;[id^=&#39; + &#39;chkPO_&#39; + po + &#39;]input:checkbox&#39;).attr(&#39;checked&#39;, isChecked);<br />&#160;&#160;&#160; }</p>
</p>
<p>and in the subgrid add these lines.</p>
</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; gridComplete: function () { <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // subgrid id contains the po number, remove &#39;jsonmap_&#39; and &#39;_t&#39; form the id to get po number<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var po = this.id.substring(this.id.indexOf(&#39;_&#39;) + 1, this.id.lastIndexOf(&#39;_&#39;));&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Determine if parent check box is checked<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var isParentChecked = $(&#39;[id=&#39; + &#39;chkPO_&#39; + po + &#39;]input:checkbox&#39;).attr(&#39;checked&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Set checkboxes in the subgrid <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;[id^=&#39; + &#39;chkPOItems_&#39; + po + &#39;_&#39; + &#39;]input:checkbox&#39;).attr(&#39;checked&#39;, isParentChecked);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</p>
</p>
<p>Regards,</p>
<p>Nagendra Kumar Yenugula</p></p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 12:05:32 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how to assoicate parent checkox to subgrid checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13523</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13523</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>If you know the id&#39;s of both grids you can attach a onclick event to every check box and perform the needed actions</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 03 Jan 2010 18:30:55 +0200</pubDate>
        </item>
        <item>
        	<title>yenkumar on how to assoicate parent checkox to subgrid checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13466</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13466</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
<p>How do you create the checkbox? &#8211; manually using the formatter or you just set multiselect to true?</p>
<p>Regards</p>
<p>Tony</p>
</blockquote>
<hr />
<p>Hi Tony,</p>
<p>I created the checkbox using java. Below is the code.</p>
</p>
<p>No, i didn&#39;t use formatter or multiselect. Please let me know if there is better approach to what i am using.</p>
</p>
<p><span style="font-size: x-small;"></span></p>
<p>checkbox.append(</p>
<p><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"&#60;input type=\\"checkbox\\" "</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"id=\\"purchaseOrder["</span></span><span style="font-size: x-small;">).append(index).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"]_["</span></span><span style="font-size: x-small;">).append(count).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"]\\""</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">" "</span></span></p>
<p><span style="font-size: x-small;">);</span></p>
<p>checkbox.append(</p>
</p>
<p>
<span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"name=\\"selectedOrderValues\\""</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">" "</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"value=\\""</span></span><span style="font-size: x-small;">).append(element.getPurchaseOrder()).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"\\""</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">" "</span></span></p>
<p><span style="font-size: x-small;">);</span></p>
<p>checkbox.append(</p>
</p>
<p>
<span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"onclick=\\"javascript:clickParentEvent(&#39;"</span></span><span style="font-size: x-small;">).append(index).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"&#39;,&#39;"</span></span><span style="font-size: x-small;">).append(itemElementSize).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"&#39;)"</span></span><span style="font-size: x-small;">).append(</span><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"\\""</span></span></p>
<p><span style="font-size: x-small;">);</span></p>
<p>checkbox.append(</p>
</p>
<p><span style="color: #2a00ff; font-size: x-small;"><span style="color: #2a00ff; font-size: x-small;">"/&#62;"</span></span><span style="font-size: x-small;">);</span></p>
<p><span style="font-size: x-small;"></p>
<p></span></p></p>
]]></description>
        	        	<pubDate>Wed, 30 Dec 2009 18:21:26 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how to assoicate parent checkox to subgrid checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13253</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13253</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>How do you create the checkbox? - manually using the formatter or you just set multiselect to true?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 22 Dec 2009 10:55:42 +0200</pubDate>
        </item>
        <item>
        	<title>yenkumar on how to assoicate parent checkox to subgrid checkbox</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13223</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-assoicate-parent-checkox-to-subgrid-checkbox#p13223</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>&#160;I am new to jqgrid. I have some issues regarding the checkboxes in jqgrid.</p>
<p>I created a checkbox in parent grid and also in subgrid.</p>
<p>How do i associate both the grids. i.e. when i check the parent checkbox i need the child element also to be checked and vice versa.&#160; I am using json datatype.</p>
<p>Looking for help ASAP.</p>
<p>regards,</p>
<p>Nagendra Kumar Yenugula</p>
]]></description>
        	        	<pubDate>Mon, 21 Dec 2009 19:24:39 +0200</pubDate>
        </item>
</channel>
</rss>