3.2.0

using two filters

Hoping someone can help me to get two filters to work in this app --
http://23ve4.com/cdrev.htm

It filters correctly on state or on party, but not state ... keep the state filter ... and then filter party. As an example, I want to filter on state=CA, then filter on party=R and have it keep the intersection of CA and R with all other parts of logic as is.

I cannot determine how to keep the subset as defined by state when party is applied. I think I am close, but missing something.

Thank you.
Warren
October 15,
Try this :
function applyFilter2(s){
if (combo.getControlText()=="State ..."){ // or... if( obj.getRowCount() == table.getCount() ) 
    var i, rows = [];
    var max = table.getCount();

    for (i=0; i<max; i++){
        if (table.getData(1, i).substr(0,1) == s.substr(0,1)){
            rows.push(i);
        }
    }
    }
    else{ // another filter in use
 	var i, rows = [], rowsDF = obj.getRowIndices();
    var max = rowsDF.length;
    
    for (i=0; i<max; i++){
    var sdd = rowsDF[i];
        if (  table.getData(1,sdd).substr(0,1) == s.substr(0,1)){
            rows.push(sdd);
        }
    }
   }
Carlos
October 15,
Sorry , is incomplete , just add

obj.clearRowModel();
obj.clearSortModel();
obj.clearScrollModel();

obj.setRowCount(rows.length);
obj.setRowIndices(rows);
}
Carlos
October 15,
And change this line also ' ...'

function showAll(){
combo.setControlText("State ..."); // same value as original load
...
October 16,
Thank you!! That works great. :)
Warren
October 16,

This topic is archived.

See also:


Back to support forum