Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #20669 > unrolled thread
| Started by | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| First post | 2013-07-15 14:55 -0600 |
| Last post | 2013-07-16 08:42 -0600 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.lang.javascript
IE Table Row Problems -- Resolved I think "Mel Smith" <med_cutout_syntel@aol.com> - 2013-07-15 14:55 -0600
Re: IE Table Row Problems -- Resolved I think "Mel Smith" <med_cutout_syntel@aol.com> - 2013-07-15 17:35 -0600
Re: IE Table Row Problems -- Resolved I think JJ <duh@nah.meh> - 2013-07-16 07:09 +0700
Re: IE Table Row Problems -- Resolved I think "Mel Smith" <med_cutout_syntel@aol.com> - 2013-07-16 08:42 -0600
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-07-15 14:55 -0600 |
| Subject | IE Table Row Problems -- Resolved I think |
| Message-ID | <b4j5v0Foci5U1@mid.individual.net> |
Hi:
I ran into problems deleting rows of a table this morning where IE
(version 8 & 10) were different in deleting rows of a table than Chrome or
FF or Safari. My resolution (after googling) is as follows :
*******************************************************************
if (getieusage() === -1) { // means *NOT*using Internet Exlorer
mytable.deleteRow(nrowindex) ; // Delete the row
}
else mytable.deleteRow(nrowindex-1) // Yes, we *ARE* using IE -- so
decrement the row index
}
// and the proper row of the table is deleted by IE, FF, and Chrome --
at least
*******************************************************************
where getieusage is as follows:
********************************************************
function getieusage()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
********************************************************
Perhaps someone can use (or improve upon) my solution.
--
Mel Smith
[toc] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-07-15 17:35 -0600 |
| Message-ID | <b4jfatFq9ltU1@mid.individual.net> |
| In reply to | #20669 |
Hi Again:
Forgot to mention that the table under discussion in my origonal post
has one header row in addition to the data rows I'm accessing -- and I
never want or allow deletion of the Header row.
-Mel
[toc] | [prev] | [next] | [standalone]
| From | JJ <duh@nah.meh> |
|---|---|
| Date | 2013-07-16 07:09 +0700 |
| Message-ID | <17n3s5uaiog6x.14k9k0um70tix$.dlg@40tude.net> |
| In reply to | #20669 |
On Mon, 15 Jul 2013 14:55:57 -0600, Mel Smith wrote:
> I ran into problems deleting rows of a table this morning where IE
> (version 8 & 10) were different in deleting rows of a table than Chrome or
> FF or Safari. My resolution (after googling) is as follows :
>
> *******************************************************************
> if (getieusage() === -1) { // means *NOT*using Internet Exlorer
> mytable.deleteRow(nrowindex) ; // Delete the row
> }
> else mytable.deleteRow(nrowindex-1) // Yes, we *ARE* using IE -- so
> decrement the row index
> }
> // and the proper row of the table is deleted by IE, FF, and Chrome --
> at least
>
> *******************************************************************
>
> where getieusage is as follows:
> ********************************************************
> function getieusage()
> // Returns the version of Internet Explorer or a -1
> // (indicating the use of another browser).
> {
> var rv = -1; // Return value assumes failure.
> if (navigator.appName == 'Microsoft Internet Explorer')
> {
> var ua = navigator.userAgent;
> var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
> if (re.exec(ua) != null)
> rv = parseFloat( RegExp.$1 );
> }
> return rv;
> }
>
> ********************************************************
>
> Perhaps someone can use (or improve upon) my solution.
Use deleteRow from the table body element.
//use first table body
mytable.tBodies[0].deleteRow(nrowindex);
Assuming you don't have multiple table bodies.
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-07-16 08:42 -0600 |
| Message-ID | <b4l4ecF6j6pU1@mid.individual.net> |
| In reply to | #20673 |
JJ said:
>> Perhaps someone can use (or improve upon) my solution.
>
> Use deleteRow from the table body element.
>
> //use first table body
> mytable.tBodies[0].deleteRow(nrowindex);
>
> Assuming you don't have multiple table bodies.
Hi JJ:
Thanks for the tip. I'll try that out today --- but this is the first
time I've heard of 'tBodies. Back to the books !
-Mel
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web