473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Cannot add row to beginning of data-bound table (IE bug!)

To reproduce: run the following code in IE 6 and right-click in table.

Observed result: Error : invalid argument at line var row =
table.insertRow(0);

Expected result: new row must be inserted.

Any idea how to add new row to beginning of data-bound table ?
Code to reproduce:

<script>
function addRowDOM (tableID) {
var table = document.getElementById(tableID);

// Next line causes error: invalid argument. Why ?
var row = table.insertRow(0);
var cell = row.insertCell(0);
cell.innerHTML = arguments[1];
}

</script>

<xml id="result" javaDSOCompatible="true"><result>
<row><item>pine</item></row>
<row><item>apple</item></row>
</result></xml>

<TABLE DATASRC="#result" id=tbl >

<tr oncontextmenu="addRowDOM('tbl','<input type=text datafld=item>');return
false;">
<td><input type=text datafld=item></input></td>
</tr></TABLE>
Jul 20 '05 #1
3 3122
Hello,

Did anyone find an answer for this? Sorry to be a pain but I am looking
everywhere and have found nothing on this subject

Regards.

Jul 23 '05 #2
It is not exactly a bug since you bound your table to a data source. if
you want to add a row you should add it to your data source and it will
be added automatically to the table. in case you do not want to add it
to your data source, you can append the new row to the thead or tfoot
sections.

Jul 23 '05 #3
VK
Where is a bug here? It's a totally correct MVC behavior. Either you are
using a table as a "view interface" to external data (then leave your
interface alone and work with data themselves), or not.

If you are trying to modify table's header (some conditional navigation
tools, for example):

var oHeader = document.getElementById(tableID).tHead;
oHeader.insertRow();

Of course, you table has to be properly set for it:

<table>
<thead>
....
</thead>
<tfoot>
....
</tfoot>
<tbody>
....
</tbody>
</table>
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: user | last post by:
I created a window with var mywindow = window.open( "some/local.html", "mywindow", "width=..., "height=...., ..." ); The window shows up. It contains a table. <table> <tr> <td>begin</td>
0
by: Norm Davis | last post by:
Greetings All Environment is Access 2000, multi-user application with back end Access MDB on the server. I lock my Counters table while retrieving the next unique counter with the following...
1
by: abc my vclass | last post by:
Why the child windows cannot to show? But when I remark the line "pf.MdiParent = this;", the frmProduct window showed but not a child window. Is it the VS 2005 bug? I write the code as: ...
3
by: Rahul B | last post by:
Hi, I have a user UCLDEV1 which is a part of staff and a group(db2schemagrp1) to which i have not given any permissions. The authorizations of that user are shown as db2 =get authorizations...
2
by: Rahul Babbar | last post by:
Hi, I am unable to reorganise the tables and get an error "SQL2216N SQL error "-968" occurred while reorganizing a database table or its indexes." Further, i find that all these tables...
0
by: Moor | last post by:
I'm unable to to open a linked table T that is stored in an Access 2.0 MDB database file (shared/back-end,) using both Access 2.0 and Access 2003, in the same time. Here is the scenario: 1-...
1
by: Gary | last post by:
Hello folks, I have a simple bug that defies my ability to find a work around. In IE7 strict-mode, if you have a table with width 100% in a DIV block.. the content will appear UNDER the div's...
2
by: Rink Web Site Developer | last post by:
Hello, I am currently having a bug with a MYSQL query for an online calendar I am writing. I have been looking at this bug for a couple days now and am still not able to figure out why it...
2
by: kkshansid | last post by:
cannot import table in mysql 1i saved my excell file in csv formate 2i made a data base in mysql 3i made a table with 5 fields 4i run this file error Parse error: syntax error, unexpected...
1
by: fred gratz | last post by:
I am using ODBC socket server to connect to a remote MS Access database. It does have table employee and timecard. When i send a query to employee table it successfully returned values by when I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.