pass value to function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharon

    #1

    pass value to function

    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.FreeThre adedDOMDocument ');
    if (m=="pos"){
    sheet.load("/lib/xtable/xTablepos.xsl") ;

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

    #2
    Re: pass value to function

    "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!

    Comment

    Working...