BUG? OR NOT A BUG?

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi all,

This is a Javascript issue for me but it is (I feel, think, expect) brought
on as a result of ASP.NET and in particular VS2005.

My app uses a GridView and I bind some labels and textboxes to the grid and
render to user.

The first column which is not bindable is simply an image. The users clicks
this image and a popup appears. The user selects something on that popup
(it's a lookup page) and then Javascript within that popup populates an
object and returns it to the parent page --> so far fine...

The receiving (i.e. parent) page receives the object and then attempts to
populate column values ON THE SAME ROW --> problem!

The very next column (i.e. immediately to the right of the image) is
populated. Columns after that are not. I'm using the following notation:
oSourceParent.children(1).firstChild.innerText = o.Code;

The above works fine but the following doesn't:

oSourceParent.children(2).firstChild.innerText = o.Code;

It seems to me that every subsequent cell being generated by ASP.NET 2.0 is
creating a double end cell (i.e. </TD></TD>).

Now when I change the Javascript to:

oSourceParent.children(3).firstChild.innerText = o.Code; ------------->
It sets the value correctly

Any takes on this? If it is a bug, does that mean MS will fix down the line
and my code will break at that point?

Regards
John.
 
if you use the dom, you can not assume the node ordering for the table (0 =
cell 0, 1 = cell 1). you should scan the table for tr, then look under the
tr children for td's. there is a table api that may be better suited to what
you are doing.

-- bruce (sqlwork.com)
 
Bruce,

Firstly, thanks a heck of a lot for your reply.

I've since discovered that the issue I previously described only happens
when the rendering is a label object (i.e. every time a label is rendered as
a column, at 2 to the ordinal position).

That aside, I am new to Javascript. Could you please provide a link of an
example of how to look for td's undare the current tr that my Javascript is
in?

Regards
John.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top