<?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: DOM insertion with jquery or javascript</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dom-insertion-with-jquery-or-javascript</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/dom-insertion-with-jquery-or-javascript/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Octavient on DOM insertion with jquery or javascript</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dom-insertion-with-jquery-or-javascript#p20331</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dom-insertion-with-jquery-or-javascript#p20331</guid>
        	        	<description><![CDATA[<p>I&#39;m struggling to insert elements into jqgrid cells using jquery or javascript--I get "object Object" appearing in the jqgrid cell, instead of the &#60;span&#62; object I should be seeing, even though my syntax seems to be correct. &#160;</p>
<p>I&#39;m using logic I found in this forum on a slightly different question, with an answer posted by Tony--it had to do with how to find the TD element and bind a click function to it. &#160;I&#39;m using the same logic, but instead of binding a click function, I&#39;m trying to append a DOM object to the TD. &#160;This syntax works fine when I&#39;m appending simple html content--but not when I&#39;m appending an object (span, div, img, etc.). &#160;Does it have to do with the sequence in which the DOM is initialized?</p>
<p>The code is: &#160;(using version 3.7.2 and XML)</p>
</p>
<p class="p1">afterInsertRow: function (rowid, data) {</p>
<p class="p1"><span style="white-space: pre;"> </span>var objSpan = document.createElement("span");</p>
<p class="p1"><span style="white-space: pre;"> </span>var txtSpan = document.createTextNode("hi, I am some text");</p>
<p class="p1"><span style="white-space: pre;"> </span>objSpan.appendChild(txtSpan);</p>
<p class="p2">&#160;</p>
<p class="p1"><span style="white-space: pre;"> </span>$("td:eq(0)","#"+rowid).append(objSpan);</p>
<p class="p1">}</p>
<p class="p2">&#160;</p>
<p class="p2">Instead of seeing "hi, I am some text" rendered in span tags by the browser, I&#39;m seeing "object Object." &#160;</p>
<p class="p2">Suggestions?</p>
]]></description>
        	        	<pubDate>Fri, 15 Oct 2010 19:19:54 +0300</pubDate>
        </item>
</channel>
</rss>