pass value to function

S

Sharon

Hi!
The solution to my problem is probably fairly simple, I just don't
know how to do this, so I hope someone will show me. Thanks in
advance!
Here's the thing:
I have a function that filters, using different XSL-sheets depending
on the filter selected by the user, e.g. you can filter on name is
"Bob" (positive filtering) or name is NOT "Bob" (negative filtering).
To pick the right XSL, I use the variable 'm' (for 'mode') in the
function 'loadsheet' (see below).

Now I also want to write a function that sorts my filtered data when a
column header is clicked in the filtered table. In order to do that
correctly, I have to know the filter mode (m), to be able to run the
same filter again AND sort at the same time. How can I pass the value
of mode (m) to the new function? I don't want to call the new function
and execute it, I just want the new function to know which mode has
been selected to filter the data. This shouldn't be too hard, I just
can't think of anything... Thanks!

function loadsheet(m){
var sheet=new ActiveXObject('MSXML2.FreeThreadedDOMDocument');
if (m=="pos"){
sheet.load("/lib/xtable/xTablepos.xsl");

}
else if (m=="neg"){
sheet.load("/lib/xtable/xTableneg.xsl")
};
return(sheet);
}
 
S

Sharon

"well, duh, ever heard of global variables?"
<oops>
thanks for not reacting and leaving it to me to realise I was being
very silly, everyone...I knéw it was simple!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,286
Latest member
ChristieSo

Latest Threads

Top