Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


TDC filter

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,25608
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> TDC filter
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 TDC filter - 9/6/2005 2:37:02 PM   
  TNO


Posts: 1036
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
How could I filter a column in a Table generated by the Tabular Data Control Object so it will show only a single instance of each value in the column?

example:
how could I filter this column

first-value
first-value
first-value
first-value
second-value
second-value
second-value
third-value
third-value


so that it would display this:

first-value
second-value
third-value


_____________________________

Consolidated Script Component: The Acid Test

A universe of complexity...
 
 
Post #: 1
 
 RE: TDC filter - 9/7/2005 3:07:50 PM   
  TNO


Posts: 1036
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Never mind, I think I got it:

function filter(){
var root = document.getElementById('tab').getElementsByTagName('tbody')[0];
var oTr = document.getElementsByTagName('tr');
for(var i=oTr.length-2;i>=0;i--){
  var oTx1=oTr.getElementsByTagName('td')[0].firstChild.data
  var oTx2=oTr[i+1].getElementsByTagName('td')[0].firstChild.data;
  if(oTx1==oTx2){root.removeChild(oTr[i+1])}
}
}


_____________________________

Consolidated Script Component: The Acid Test

A universe of complexity...

(in reply to TNO)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> TDC filter Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts