How to I remove rows in the table.response before the grid is generated?

I read in an XML dataset that I don't have control over. But I only want the data that has a statuscode that matches "ep" and "uc".

So I was thinking:

table.response1 = table.response;
table.response = function(doc){
this.response1(doc); // first call the original one
var i, holdItem, rowCount = this.getCount();
// remove non "EP" and non "UC"
for (i=0; i<rowCount; i++) {
if (this.getData(7,i) <> "EP" || this.getData(7,i) <> "UC") {

I know the above is wrong, but I can't figure out how to do it. Thing is, I can't use the "setRowIndices" to mask them off because other filters would make still process them.

When I read in a dataset, how can I selete rows before the grid populates?
June 8,
You can also use XPath to select the table rows -

table.setRows("company[ticker='MSFT' or ticker='ORCL']");

or, in your case

table.setRows("*[statuscode='ep' or statuscode ='uc']");
Alex (ActiveWidgets)
June 8,
I tried the above (and some variations), but I think I'm still lost on how to format the xpath piece because I get no rows back in the grid. Might you be able to hepl with the xpath so I can bring this webpage live?

Sorry to be a pain - any help you can give would be appreciated.
table.setRows("*[statuscode='ep' or statuscode ='uc']");

I'm using (segment of XML):

<?xml version="1.0" encoding="utf-8" ?> 
  <Description>Convert the Bergen-Leonia 138kV circuit Description> 
  <Region>PJM MA</Region> 
  <RevisedDesc>The Bergen-Leonia 138kV </RevisedDesc> 
  <StudyYear>2000 RTEP Baseline</StudyYear> 
  <Driver>Contingency Overload</Driver> 

June 8,
I'm a moron - never mind. Forgot bout case-sensitivty.

My bad - thanks for the help.

June 8,
I guess it should be

table.setRows("*[StatusCode='EP' or StatusCode='UC']");

- XPath is case-sensitive.
Alex (ActiveWidgets)
June 8,
oops, too late :-)
Alex (ActiveWidgets)
June 8,

This topic is archived.

See also:

Back to support forum