Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Urgent plz help: move up Rows in a table through Javascript in IMAC IE

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using table.moveRow() function in IE to move the row contents up on click of a button, for NS and NS6 am assigning the innerHTML to the previous row and the previous row innerhtml to the present Row.
Thesee things are working fine for Windows NT and 2k IE and NS, IMAC NS
but this code is not working in IMAC IE Cud anybody please help me how to go about it?
My javascript goes like this
var BrowserType;
var rowCounter = 0;var row_count=0;
function checkbrowser()
{
var agt=navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.nav = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
if (this.nav)
{
BrowserType='NS';
}
this.ie = (agt.indexOf("msie") != -1);
if (this.ie)
{
BrowserType='IE';
}
if (agt.indexOf("netscape6")!=-1)
{
BrowserType='NS6';
}
return BrowserType;
}
var checkb;
function moveUp(trPrev, trPresent)
{
otable = document.getElementById('personalizeTab');
var n=0;
var sel_row;
checkb = checkbrowser();
alert(checkb);
if(checkb == "IE")
{
for(i=0;i<otable.rows.length;i++)
{
if(otable.rows(i).id==trPresent)
{
n=i;
}
}
alert('n:'+n);
if(n>0)
{
//otable.moveRow(n,n-1);
}
}
else
{
for(i=0;i<otable.rows.length;i++)
{
if(otable.childNodes[1].childNodes[i].id==row_id)
{
n=i;
sel_row=otable.childNodes[1].childNodes[i];
}
}
if(n>0)
{
if(checkb=="NS")
{
prev_sib=sel_row.previousSibling;
parent_node=sel_row.parentNode;
if(prev_sib!=null)
{
parent_node.insertBefore(sel_row,prev_sib);
}
}
else
{
var lb_prevLink = document.getElementById(trPrev).innerHTML;
document.getElementById(trPrev).innerHTML = document.getElementById(trPresent).innerHTML;
document.getElementById(trPresent).innerHTML = lb_prevLink;
}
}}
}
here the arguments for function moveUp is trPrev (prevoius row id) and trPresent (present row id)

Please help
regards,
sowmya
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you tried the Netscape method with the IE of IMAC?
 
Arthur, where are your pants? Check under this tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic