<?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: Call a function from gridComplete?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/call-a-function-from-gridcomplete</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/call-a-function-from-gridcomplete/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>w4ik on Call a function from gridComplete?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/call-a-function-from-gridcomplete#p16903</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/call-a-function-from-gridcomplete#p16903</guid>
        	        	<description><![CDATA[<p><strong>-----------------------------------------------------------------------------------------------------------------------------------</strong></p>
<p><strong>Check here for the answer</strong></p>
<p><strong><a href="http://stackoverflow.com/questions/2774018/call-a-function-from-a-button-that-is-created-during-jqgrids-gridcomplete-event/2774104#2774104" rel="nofollow" target="_blank"><a href="http://stackoverflow.com/quest" rel="nofollow">http://stackoverflow.com/quest</a>.....04#2774104</a></strong></p>
<p><strong>-----------------------------------------------------------------------------------------------------------------------------------</strong></p>
<p>I&#39;m trying to call a function in the onClick event of the button that is created during the gridComplete function..Loads OK&#8230;here&#39;s what the rendered html looks like for the button in the first row</p>
<p>&#60;input type="button" onclick="deleteRow(9197113);" value="Delete" style="height: 22px; width: 70px;"&#62;</p>
</p>
<p>but when i click the button&#8230;the function is not called and firebug says&#8230;.</p>
<p>deleteRow is not defined</p>
</p>
<p>How can I call a function, rather than having inline javascript,,,(which does work BTW, but I&#160; would like to call the function for readability and maintainability).</p>
<p>Below is the grid Complete portion of the jqGrid settings.</p>
<p>jQuery("#list").jqGrid({</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridComplete: function() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ids = jQuery("#list").jqGrid(&#39;getDataIDs&#39;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (var i = 0; i &#60; ids.length; i++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cl = ids[i];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; de = "&#60;input style=&#39;height:22px;width:70px;&#39; type=&#39;button&#39; value=&#39;Delete&#39; onclick=&#39;deleteRow(&#39;" + cl + "&#39; );&#39; /&#62;";&#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; jQuery("#list").jqGrid(&#39;setRowData&#39;, ids[i], { Delete: de });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
<p>&#160;});</p>
<p>Here&#39;s the deleteRow() function&#8230;</p>
<p>&#160;&#160;&#160; function deleteRow() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert("hit delete button");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // jQuery("#grid_id").jqGrid(&#39;delGridRow&#39;, row_id_s,options ); <br />&#160;&#160;&#160; }</p></p>
]]></description>
        	        	<pubDate>Tue, 04 May 2010 23:54:43 +0300</pubDate>
        </item>
</channel>
</rss>