Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by hony on Sep 11, 2009 02:28
open dhtmlx forum
filter data is so slow

when i do filter data,it is more than 300 rows ,wow ! it is filteing very slow.
can you help me how to do ?
Answer posted by Support on Sep 11, 2009 02:31
You can try to enable srnd mode - it must resolve the performance problems. 
http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/08_filtering/05_pro_filter_srnd.html
Answer posted by hony on Sep 11, 2009 07:59

hi. this is the drag -n-drop and filter problem

at first i dont make enableSmartRendering turn on,so filter 300 data is too slow ,then i turn it on , i find that filter data is very fast ,but when i get 1000 data and drag one data  from mygrid1  drop to mygrid2,i find it begin slow.

how to make it fast? can you tell me some to try?  bellow is my code.  thanks.   

 mygrid1 = new dhtmlXGridObject('gridbox1');
  mygrid1.setImagePath("imgs/xdhtml/");
  mygrid1.setHeader("awbNo,awbStatus,awbDate,awbFrom,awbTo,awbArrive,awbName,awbNumber,awbBy,awbFor");
  mygrid1.setInitWidths(90 + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width); 
  mygrid1.setColAlign("center,center,right,right,right,right,right,right,right,right");
  mygrid1.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");
  mygrid1.setColSorting("int,str,str,str,str,str,str,str,str,str")
  mygrid1.enableEditEvents(false, false, true);   
  mygrid1.enableDragAndDrop(false);mygrid1.setOnRowDblClickedHandler(leftMove); 
  mygrid1.init(); 
  mygrid1.setSkin("light");

 

mygrid2 = new dhtmlXGridObject('gridbox2');
  mygrid2.setImagePath("imgs/xdhtml/");
  mygrid2.setHeader("awbNo,awbStatus,awbDate,awbFrom,awbTo,awbArrive,awbName,awbNumber,awbBy,awbFor");
  mygrid2.setInitWidths(90 + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width + "," + width); 
  mygrid2.setColAlign("center,center,right,right,right,right,right,right,right,right");
  mygrid2.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");
  mygrid2.setColSorting("int,str,str,str,str,str,str,str,str,str")
  mygrid2.enableEditEvents(false, false, true);   
  mygrid2.attachHeader("#text_filter,-,-,-,-,-,-,-,-,-");
  mygrid2.enableDragAndDrop(false);
  mygrid2.init(); 
  mygrid2.setSkin("light");
  mygrid2.enableSmartRendering(true);  
  mygrid2.setAwaitedRowHeight(20);
  mygrid2.setOnRowDblClickedHandler(rightMove); 
        if("${resultXml}"!="null" && "${resultXml}"!=""){   
           mygrid2.loadXMLString("${resultXml}");            
        }

function rightMove() {
        var mid = mygrid2.getSelectedRowId();
        mygrid2.filterBy(0);
        if(!mygrid1.doesRowExist(mid)){
        mygrid2.moveRow(mid, 'row_sibling', mid, mygrid1);     
        }
        mygrid2._srowsCol=mygrid2._f_rowsBuffer=mygrid2._srowsBuf=null;
        mygrid2.filterByAll();     
}

function leftMove() {
var mid = mygrid1.getSelectedRowId();
        var mid = mygrid1.getSelectedRowId();
        mygrid2.filterBy(0);
        mygrid1.moveRow(mid, 'row_sibling', mid, mygrid2);
        mygrid2._srowsCol=mygrid2._f_rowsBuffer=mygrid2._srowsBuf=null;
        mygrid2.filterByAll();
}

 hony,look for your answer..