Re: DHTML tables generate R6025 pure virtual function call error in IE6 any ideas??
- From: "Steve" <dudesterr@xxxxxxxxx>
- Date: 15 Sep 2006 09:07:00 -0700
hi and thanks for replyin
just like you said i cannot delete a row after inserting it
or more specific it is delete it but if i hover over the first cell in
any of the remaining rows i get this error .
fortunately i solved the issue with just a single line ,irrelevant in
fact, of code
imagine that IE huh!
i just added
row_to_delete.innerText=""
just before the delete row line and tada!! it's gone
now i dunno how this could be interpreted or whta this stupid line's
effect was over IE but it's IE right !
i hope this helps people who encounter the same problem
thanks again
RobG wrote:
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
.
- References:
- Prev by Date: Re: usefull javascript page
- Next by Date: Re: Mystified....
- 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):