Perfomance Issue in Filters

I have a grid with more than 1000 rows.I applied a filter to one of the fields “project” in the header.When i enter a name in the filter text box, it is taking more time to display the row.Sometimes the screen is strucked and it ended with killing the process of the screen.



Is there any way to improve the performance of filter for the larger grid.Here is the peice of code i used



function filterBy(mygrid3, elementId, colNum){

//alert(“Called”);

var tVal = document.getElementById(elementId).childNodes[0].value.toLowerCase();

//tVal = document.getElementById(elementId).childNodes[0].selectedItem();

//alert(“tVal = " + tVal);

mygrid3.expandAll();

for(var i=0; i< mygrid3.getRowsNum();i++)

    {

var tStr = mygrid3.cells2(i,colNum).getValue().toString().toLowerCase();

if(tVal==”" || tStr.indexOf(tVal)==0){

mygrid3.setRowHidden(mygrid3.getRowId(i),false);

checkId = mygrid3.getRowId(i);

while (mygrid3.getLevel(checkId) > 0){

mygrid3.setRowHidden(mygrid3.getParentId(checkId),false);

checkId = mygrid3.getParentId(checkId);

}

}

else{

mygrid3.setRowHidden(mygrid3.getRowId(i),true);



}

}

}



Please help me on this.



Starting from grid 1.5 , there is buile in filtering functionality which works much more faster than custom solutions.
dhtmlx.com/docs/products/dhtmlxT … 8618789000