-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vbturbo
Message 1 in Discussion
Hi all
Im doing some dynamic row filter in a table
The below code in ex 1 works just fine alltough its letter case sensitive
but soon as i populate the same table data from a xml file "fill method(DSO)"
se below ex.2
for some reason it stops filtering ??? could it be that the collums are spanned
?
is there somebody wise who can see where i dropped the ball !
__________________________________________________________-
EX.1
<html>
<head>
<title>Html Row Filter</title>
<script language="JavaScript" >
var colKey_Name = 0;
var colKey_Group = 1;
var colKey_Salary = 2;
var colKey_Zone = 3;
var colKey_Status = 4;
function filterTab(theField,tabID,colKey){
var row = document.getElementById(tabID).rows;
for(var i=0;i<row.length;i++){
if(row[i].className=="dataRow"){
var cell=row[i].cells;
if(cell[colKey].innerHTML.indexOf(theField.value)<0){
row[i].style.display="none";
} else {
row[i].style.display="block";
}
}
}
}
</script>
</head>
<body>
<form ID="Form1">
<table id="dataTable" cellspacing="0" cellpadding="2" border="1">
<tr class="dataRow">
<td width="80">Joe</td>
<td width="100">Alpha</td>
<td width="100">400 USD</td>
<td width="180">North,South</td>
<td width="80">Off-Site</td>
</tr>
<tr class="dataRow">
<td width="80">Celest</td>
<td width="100">Beta</td>
<td width="100">50000 YEN</td>
<td width="180">North</td>
<td width="80">OK</td>
</tr>
<tr class="dataRow">
<td width="80">Brian</td>
<td width="100">Alpha</td>
<td width="100">4000 SGD</td>
<td width="180">North,East,South</td>
<td width="80">Off-Site</td>
</tr>
<tr class="dataRow">
<td width="80">David</td>
<td width="100">Alpha</td>
<td width="100">7000 SGD</td>
<td width="180">West,South</td>
<td width="80">On Leave</td>
</tr>
<tr class="dataRow">
<td width="80">Pauline</td>
<td width="100">Gamma</td>
<td width="100">450 USD</td>
<td width="180">West</td>
<td width="80">On Leave</td>
</tr>
<tr class="dataRow">
<td width="80">April</td>
<td width="100">Gamma</td>
<td width="100">2400 SGD</td>
<td width="180">North, West</td>
<td width="80">OK</td>
</tr>
<tr class="dataRow">
<td width="80">Sharon</td>
<td width="100">Beta</td>
<td width="100">2000 SGD</td>
<td width="180">East,South</td>
<td width="80">Off-Site</td>
</tr>
<tr class="dataRow">
<td width="80">Paul</td>
<td width="100">Beta</td>
<td width="100">2500 SGD</td>
<td width="180">North,South,East,West</td>
<td width="80">On Leave</td>
</tr>
</table>
</form>
<input type="text" name="fltName" size="20"
onKeyUp="filterTab(this,'dataTable',colKey_Name)" ID="Text1">
</body>
</html>
----------------------------------------------------------------------
EX.2
___________________________________________________________
<XML SRC="source.xml" ID="topic"></XML>
<table id="dataTable" dataSrc="#topic" cellpadding="2" border="1">
<tr class="dataRow">
<TD><SPAN dataFld="Name"></SPAN></TD>
<TD><SPAN dataFld="Group"></SPAN></TD>
<TD><SPAN dataFld="Salary"></SPAN></TD>
<TD><SPAN dataFld="Zone"></SPAN></TD>
<TD><SPAN dataFld="Status"></SPAN></TD>
</tr>
</table> and the xml file... source.xml ! <?xml version = "1.0"?>
<ACCOUNTS>
<Topic>
<Name>Joe</Name>
<Group>Alpha</Group>
<Salary>400 USD</Salary>
<Zone>North,South</Zone>
<Status>Off-Site</Status>
</Topic>
<Topic>
<Name>JCelest</Name>
<Group>Beta</Group>
<Salary>50000 YEN</Salary>
<Zone>North</Zone>
<Status>OK</Status>
</Topic>
<Topic>
<Name>Brian</Name>
<Group>Alpha</Group>
<Salary>4000 SGD</Salary>
<Zone>North,East,South</Zone>
<Status>Off-Site</Status>
</Topic>
<Topic>
<Name>David</Name>
<Group>Alpha</Group>
<Salary>7000 SGD</Salary>
<Zone>North,South</Zone>
<Status>On Leave</Status>
</Topic>
<Topic>
<Name>Pauline</Name>
<Group>Gamma/Group>
<Salary>450 USD</Salary>
<Zone>West</Zone>
<Status>On Leave</Status>
</Topic>
<Topic>
<Name>April</Name>
<Group>Gamma</Group>
<Salary>2400 SGD</Salary>
<Zone>North,West</Zone>
<Status>OK</Status>
</Topic>
</ACCOUNTS>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]