Re: DHTML tables generate R6025 pure virtual function call error in IE6 any ideas??
- From: "RobG" <rgqld@xxxxxxxxxxxx>
- Date: 14 Sep 2006 21:29:37 -0700
Jim Davis wrote:
"Steve" <dudesterr@xxxxxxxxx> wrote in message
news:1158261408.820903.71930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi all,
i'm using DHTML to generate a dynamic table with adding removing and
sorting rows
the thing is after a row has been added at a position that i specify,
if i try to delete it i get this error !
This happens in IE - it's a known bug. You can't manipulate IE tables at
the DOM levelin this way (adding and removing elements).
Do you mean that you can't use delete row if you added a row using
insert row? The following test case below works fine in IE.
Generally you'll end up having to repaint the entire table.
I've never resorted to that except when sorting an entire table, and
then it is a matter of doing a shallow clone of the tbody, appending
the rows from the old table in order, then replacing the (now empty)
old tbody with the new one.
This strategy works nicely with tables that have one or more sections.
Anyhow, the demo below is just for insert/deleteRow.
<script type="text/javascript">
function addRows(tableID, num){
var t = document.getElementById(tableID);
var r, c;
for (var i=0; i<num; i++){
r = t.insertRow(-1);
c = r.insertCell(-1);
c.innerHTML = 'New row ' + i;
}
}
function deleteRow(tableID, rowIndex){
var t = document.getElementById(tableID);
if (rowIndex < t.rows.length){
t.deleteRow(rowIndex);
} else {
alert('Can\'t delete row ' + rowIndex
+ ' as there are only ' + t.rows.length
+ ' in the table');
}
}
</script>
<form action=""><div>
<label for="i0">Rows to add or index to delete<input type="text"
id="i0" name="num" value="1"></label><br>
<input type="button" value="Add rows"
onclick="addRows('xx', this.form.num.value)">
<input type="button" value="Delete row"
onclick="deleteRow('xx', this.form.num.value)">
</div></form>
<table id="xx">
<tr><td>original row
</table>
--
Rob
.
- Follow-Ups:
- References:
- Prev by Date: Re: DHTML tables generate R6025 pure virtual function call error in IE6 any ideas??
- Next by Date: Re: Folder location validation
- Previous by thread: Re: DHTML tables generate R6025 pure virtual function call error in IE6 any ideas??
- Next by thread: Re: DHTML tables generate R6025 pure virtual function call error in IE6 any ideas??
- Index(es):