<?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 activate the Form Edit from custom input button</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-activate-the-form-edit-from-custom-input-button</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-activate-the-form-edit-from-custom-input-button/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Meng Hai on How to activate the Form Edit from custom input button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-activate-the-form-edit-from-custom-input-button#p14555</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-activate-the-form-edit-from-custom-input-button#p14555</guid>
        	        	<description><![CDATA[<p>Found it.</p>
<p>for Add:</p>
<p>jQuery("#griddetail").jqGrid("editGridRow","new");</p>
</p>
<p>for Edit:</p>
<p>jQuery("#griddetail").jqGrid("editGridRow","idno"); //replace "new" with record id no eg "2"</p>
</p>
<p>for Delete:</p>
<p>jQuery("#griddetail").jqGrid("delGridRow","idno");</p>
</p>
<p>Eg of use in Delete button:</p>
<p>$("#buttDelete","#t_griddetail").click(function(){<br />&#160;&#160;&#160; var s;<br />&#160;&#160;&#160; s = jQuery("#griddetail").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;); //get the selected record no<br />&#160;&#160;&#160; if (s==null){<br />&#160;&#160;&#160;&#160;&#160;&#160; alert("Please select a record.");<br />&#160;&#160;&#160; }else{<br />&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#griddetail").jqGrid("delGridRow",s,{reloadAfterSubmit:true,jqModal:false, closeOnEscape:true});<br />&#160;&#160;&#160; }<br />});</p>
</p>
<p>hope this help someone else<img class="spSmiley" style="margin:0" title="Cool" src="/blog/wp-content/forum-smileys/sf-cool.gif" alt="Cool" /></p>
]]></description>
        	        	<pubDate>Fri, 05 Feb 2010 06:01:13 +0200</pubDate>
        </item>
        <item>
        	<title>Meng Hai on How to activate the Form Edit from custom input button</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-activate-the-form-edit-from-custom-input-button#p14549</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-activate-the-form-edit-from-custom-input-button#p14549</guid>
        	        	<description><![CDATA[<p>Firstly bec I do not know how to dynamically enable/disable the Edit button in the navGrid toolbar, I thought of creating my own buttons in a new Toolbar. I am able to enable/disable my custom buttons depending on the selected row. But how to I activate the Form Edit to simulate a click of the Edit button in the navGrid toolbar?</p>
<p>Better still if someone can tell me if dynamically enable/disable the Edit button in the navGrid toolbar is possible, and if so how to go about it.</p>
<p>I did this:</p>
<p>toolbar: [true,"top"]</p>
<p>And I check my row record with this:</p>
<p>&#160;onSelectRow: function(ids) {<br />&#160;&#160;&#160;var ffs = $(&#39;#griddetail&#39;).jqGrid(&#39;getCell&#39;, ids, "Confirmed"); <br />&#160;&#160;&#160;if (ffs==1){<br />&#160;&#160;&#160;&#160;$("#buttEdit","#t_griddetail").attr("disabled",true); //if record is confirmed - do not allow&#160;editing<br />&#160;&#160;&#160;}else{<br />&#160;&#160;&#160;&#160;$("#buttEdit","#t_griddetail").attr("disabled",false);<br />&#160;&#160;&#160;}<br />&#160;}</p>
<p>Then added this:</p>
<p>$("#t_griddetail").append("&#60;input type=&#39;button&#39; value=&#39; Edit &#39; disabled=true id=&#39;buttEdit&#39; style=&#39;height:20px;font-size:-3&#39;/&#62;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;");</p>
<p>Now what should I do if I wanted to activate the Form for Editing?</p>
<p>$("#buttEdit","#t_griddetail").click(function(){<br />&#160;<br />});</p>
</p>
<p>Thanks.</p></p>
]]></description>
        	        	<pubDate>Thu, 04 Feb 2010 20:10:41 +0200</pubDate>
        </item>
</channel>
</rss>