<?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: editGridRow throws error in IE7 and IE8</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/editgridrow-throws-error-in-ie7-and-ie8</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/editgridrow-throws-error-in-ie7-and-ie8/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>ryoung on editGridRow throws error in IE7 and IE8</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editgridrow-throws-error-in-ie7-and-ie8#p27970</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editgridrow-throws-error-in-ie7-and-ie8#p27970</guid>
        	        	<description><![CDATA[<p>First, the demo page seems to work but I want to call the editGridRow function a little differently. &#160;I am using version 4.4.1 and have tried both jquery 1.7.1 and jquery 1.8.2. &#160;The error thrown is "Unable to get value of property &#39;p&#39;: object is null or undefined". &#160;The error is raised by line 7205:</p>
<pre>rp_ge[$(this)[0].p.id]&#160;=&#160;p;
</pre>
<pre></pre>
<pre>It appears that neither IE7 or IE8 knows what "this" is in the context.</pre>
<pre></pre>
<pre>I&#39;m not good enough with javascript to fix this. </pre>
<pre></pre>
<pre>First, I use a custom formatter to add a "edit" icon to the grid:</pre>
<pre></pre>
<pre>formatter:&#160;function&#160;(cellvalue,&#160;options,&#160;rowObject)&#160;{
					return&#160;editButton(rowObject.Id);</pre>
<pre>function&#160;editButton(id,&#160;grid)&#160;{
	return&#160;"&#60;input&#160;type=&#39;button&#39;&#160;value=&#39;&#38;nbsp;&#39;&#160;title=&#39;Edit&#160;row&#39;&#160;class=&#39;grid-button&#160;grid-edit-button&#39;&#160;onclick="editGridRow(event,&#39;"&#160;+&#160;id&#160;+&#160;"&#39;);"&#160;/&#62;";
}</pre>
<pre></pre>
<pre>Then I call the editGridRow function like this:</pre>
<pre></pre>
<pre></pre>
<pre>function&#160;editGridRow(event,&#160;id)&#160;{
&#160;&#160;&#160;&#160;var&#160;button&#160;=&#160;$(event.target);
&#160;&#160;&#160;&#160;var&#160;grid&#160;=&#160;button.closest(&#39;table&#39;);
&#160;&#160;&#160;&#160;grid.jqGrid(&#39;editGridRow&#39;,&#160;id,&#160;editGridRowOptions);
}</pre>
<pre></pre>
]]></description>
        	        	<pubDate>Wed, 02 Jan 2013 17:11:46 +0200</pubDate>
        </item>
</channel>
</rss>