<?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 do you toggle the sub grid indicators (+ - ) based on row content </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content</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-do-you-toggle-the-sub-grid-indicators-based-on-row-content/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4485</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4485</guid>
        	        	<description><![CDATA[<p>For those that have been following this thread:</p>
<p>To toggle the subgrid indicator on/off based on field(s) in your main query.</p>
<p><code>$("#mygrid").jqGrid({ </code></p>
<p><code>..., </code></p>
<p><strong>&#160;&#160;&#160;&#160;afterInsertRow : function(rowid,rowdata,rowelem) {<br />&#160;&#160;&#160;&#160;if (rowdata.x_parent_type == "children" &#38;&#38; rowdata.x_parent_objid == 0)<br />&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#"+rowid+" td:eq(0)").empty().unbind("click");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;<br />&#160;&#160;&#160;&#160; },</strong></p>
<p><code>... </code></p>
<p><code>}); </code></p>
<p><code>In my instance my query returned two fields (hidden) that controled the toggle.</code></p>
<p><code>Have fun and Tony thanks again,&#160; Jim</code></p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 12:46:24 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4473</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4473</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>Thanks once again.&#160; As you can tell I am just learning javascript.&#160; I have no one I work with to ask questions.&#160; I&#39;m trying to learn it as I go.</p>
<p>You have been very helpful.</p>
<p>Thanks again,&#160; Jim</p></p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 09:25:12 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4472</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4472</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Maybe it is a good idea to learn how to get values from JS object. Sorry if this make you something wrong, but expression of type:</p>
<p>rowdata:x_parent_objid does not exists at all in JS - you should do something like this:</p>
<p>note the . and not :</p>
<p>if ( parseInt(rowdata.x_parent_objid) &#62; 0 &#38;&#38; rowdata.x_parent_type !== &#39;children&#39;) {</p>
<p>// do something here</p>
<p>}</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 09:11:58 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4470</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4470</guid>
        	        	<description><![CDATA[<p>Thanks Tony,</p>
<p>That worked!&#160; The problem was the wrong &#8221; - correct ".</p>
<p>The if statement still isn&#39;t working.</p>
<p>&#160;afterInsertRow : function(rowid,rowdata,rowelem) {<br />&#160;&#160;&#160;&#160; if (rowdata:x_parent_objid:value &#62; 0 &#38;&#38; rowdata:x_parent_type:value !== "children") <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#"+rowid+" td:eq(0)").empty().unbind("click");<br />&#160;&#160;&#160;&#160; },</p>
<p>No errors in FB, just doesn&#39;t return anything. Blank screen.</p>
<p>Thanks again,&#160; Jim</p></p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 08:59:41 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4468</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4468</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You should not copy paste the code from here, but understand what I try to expalin.</p>
<p>Here is a working example tested on my demo:</p>
</p>
<p><code> $("#mygrid").jqGrid({ </code></p>
<p><code>..., </code></p>
<p><code>afterInsertRow : function(rowid,rowdata,rowelem) {</code></p>
<p><code> $("#"+rowid+" td:eq(0)").empty().unbind("click"); </code></p>
<p><code>}, </code></p>
<p><code>... </code></p>
<p><code>}); </code></p>
<p>Hope this helps</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 08:24:26 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4467</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4467</guid>
        	        	<description><![CDATA[<blockquote>
<p>Jim P said:&#160; The error statement got moved to the bottom of my last post.</p>
<p>Tony,</p>
<p>In Firebug on FF I get this error on the code you ask me to run.</p>
<div class="errorTitle"><strong>illegal character</strong></div>
<div class="errorTrace"><strong></strong></div>
<div class="errorSourceBox errorSource-syntax"><strong>&#160;</strong></div>
<div class="errorSourceBox errorSource-syntax"><span class="errorSource"><strong>&#160;$(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;));},\\n</strong></span></div>
<p>From running this code:</p>
<p>afterInsertRow: function(rowid,rowdata,rowelem){<br />&#160;&#160;&#160;&#160;&#160; $(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;));<br />&#160;},</p>
</blockquote>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 07:44:19 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4466</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4466</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>In Firebug on FF I get this error on the code you ask me to run.</p>
<p><span class="objectBox objectBox-errorMessage hasBreakSwitch opened"></span>
</p>
<p>From running this code:</p>
<p>afterInsertRow: function(rowid,rowdata,rowelem){<br />&#160;&#160;&#160;&#160;&#160; $(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;));<br />&#160;},</p>
<p>The answer to your second question of what I was trying to do with this statement:</p>
<p><strong>if (rowid &#38;&#38; rowdata:x_parent_type:value !== &#8220;children&#8221;)</strong></p>
<p>In my top grid query, NOT all rows will have a sub rows.&#160; The x_parent_type column will have a value of "children" if there are sub rows.&#160; If the the value of the x_parent_type is NOT Equal to "children" I need to disable the subgrid toggle.</p>
<p>Thanks, Jim</p>
</p>
<div class="errorTitle"><strong>illegal character</strong></div>
<div class="errorTrace"><strong></strong></div>
<div class="errorSourceBox errorSource-syntax"><strong>&#160;</strong></div>
<div class="errorSourceBox errorSource-syntax"><span class="errorSource"><strong>&#160;$(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;));},\\n</strong></span></div>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 07:42:00 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4445</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4445</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Could you please try only this to be a sure that all subgrids are empty:</p>
<p><strong>afterInsertRow: function(rowid,rowdata,rowelem){<br />&#160;&#160;&#160;&#160;&#160; $(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;));<br />&#160;}</strong></p>
<p>This will ensure that the code is working.</p>
<p>Also I&#39;m not sure what you try to do with this</p>
<p><strong> if (rowid &#38;&#38; rowdata:x_parent_type:value !== &#8220;children&#8221;)</strong></p>
]]></description>
        	        	<pubDate>Fri, 06 Feb 2009 03:05:42 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4429</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4429</guid>
        	        	<description><![CDATA[<p>Anyone,&#160;</p>
<p>I&#39;ve been search your documentation and the web all day.&#160; I can&#39;t find the syntax to use for the&#160; <em>afterInsertRow </em>event.&#160; This is what I&#39;ve got:</p>
<p>&#160;&#160;&#160;&#160;colModel :[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;x_object_id&#39;,index:&#39;x_object_id&#39;, align:"center", sorttype:"string", width:80},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_priority&#39;,index:&#39;x_priority&#39;,&#160; align:"center", sorttype:"string", width:80},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_site_id&#39;,index:&#39;x_site_id&#39;,&#160; align:"center",sorttype:"string", width:90},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_site_name&#39;,index:&#39;x_site_name&#39;,&#160; align:"center",sorttype:"string", width:150},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_status&#39;,index:&#39;x_status&#39;,&#160; align:"center", sorttype:"string", width:100},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_title&#39;,index:&#39;x_title&#39;,&#160; align:"left", sorttype:"string", width:300},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_creation_dt&#39;,index:&#39;x_creation_dt&#39;,&#160; align:"center", sorttype:"string", width:200},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;objid&#39;,index:&#39;objid&#39;, hidden:true},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_object_objid&#39;,index:&#39;x_object_objid&#39;, hidden:true},<br />&#160;&#160;&#160;&#160;&#160;{name:&#39;x_parent_type&#39;,index:&#39;x_parent_type&#39;, hidden:true}<br />&#160;&#160;&#160;&#160;],<br /><strong>&#160;&#160;&#160;&#160;afterInsertRow: function(rowid,rowdata,rowelem){<br />&#160;&#160;&#160;&#160;&#160;&#160; if (rowid &#38;&#38; rowdata:x_parent_type:value !== "children"){ <br />&#160;&#160;&#160;&#160;&#160;&#160;$(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;)); &#160;1&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;},</strong></p>
<p>This of course doesn&#39;t work but I can&#39;t find an example any where.</p>
<p>The condition I&#39;m testing for is:</p>
<p>&#160;if the x_parent_type does not have a value of children</p>
<p>Remove the the + toggle from the row.</p>
<p>thanks again,&#160; Jim</p>
<p><strong></strong></p>
<p><strong></strong></p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 15:28:12 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4418</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4418</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>I&#39;m completely lost here.&#160; I don&#39;t see any examples on how to do this in the documentation.</p>
<p>If my query returns a field [gotsubs], how do I&#160;test that field as the grid is rendered.&#160; Then if [gotsubs] is true, do this:</p>
<p>$(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;)</p>
<p>Jim</p></p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 10:00:56 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4413</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4413</guid>
        	        	<description><![CDATA[<p>Sorry,</p>
<p>Try this:</p>
<p>$(&#8221;#&#8221;+rowid+&#8221; td:eq(0)&#8221;).empty().unbind(&#8221;click&#8221;)</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 09:02:46 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4412</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4412</guid>
        	        	<description><![CDATA[<p>I&#39;m a complete nubie to jqgrid.&#160; Can you show me and example where to place that code.&#160; I&#39;ve been searching both the online documentation and the manual I downloaded on how to add the code.</p>
<p>TIA - Jim</p></p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 08:57:39 +0200</pubDate>
        </item>
        <item>
        	<title>junwei on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4411</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4411</guid>
        	        	<description><![CDATA[<p>The above method does work however when click on the cell, the icon show up again. Is there any way to totally disable subgrid button for that particular row?</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 08:39:54 +0200</pubDate>
        </item>
        <item>
        	<title>tony on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4383</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4383</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Humm - very interesting. Also as main directions - you can remove the image from the subgrid column and unbind the click (in this case the toggle) something like this: I suppose the subgrid column is the first and you have the rowid</p>
</p>
<p>$("#"+rowid+" td:eq(0)").empty().unbind("toggle")</p>
<p>Please let me known if this work.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 01:26:55 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on how do you toggle the sub grid indicators (+ - ) based on row content </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4331</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-do-you-toggle-the-sub-grid-indicators-based-on-row-content#p4331</guid>
        	        	<description><![CDATA[<p>Not all of the main grid rows will have a sub row.&#160; This is indicated by one of the fields returned with the row.&#160;&#160; In the documentation I see code to disable/enable a sub grid:&#160; $("grid_id").hideCol("subgrid").</p>
<p>Can this be used with the&#160;postdate function to archieve the desired effect of not displaying (+ or -) when there isn&#39;t any sub row to display?</p>
<p>Do you have any examples of code to perform this?</p>
<p>TIA,&#160; Jim</p>
]]></description>
        	        	<pubDate>Tue, 03 Feb 2009 10:29:29 +0200</pubDate>
        </item>
</channel>
</rss>