Forum


I'm struggling to insert elements into jqgrid cells using jquery or javascript--I get "object Object" appearing in the jqgrid cell, instead of the <span> object I should be seeing, even though my syntax seems to be correct.
I'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. I'm using the same logic, but instead of binding a click function, I'm trying to append a DOM object to the TD. This syntax works fine when I'm appending simple html content--but not when I'm appending an object (span, div, img, etc.). Does it have to do with the sequence in which the DOM is initialized?
The code is: (using version 3.7.2 and XML)
afterInsertRow: function (rowid, data) {
var objSpan = document.createElement("span");
var txtSpan = document.createTextNode("hi, I am some text");
objSpan.appendChild(txtSpan);
$("td:eq(0)","#"+rowid).append(objSpan);
}
Instead of seeing "hi, I am some text" rendered in span tags by the browser, I'm seeing "object Object."
Suggestions?
Most Users Ever Online: 715
Currently Online:
59 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66