Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sdt on Aug 29, 2009 10:21
open dhtmlx forum
Smart Rendering using CSV source

Is there anyway to enable smart rendering when using data from csv ? i can't find any tutorial about this.
Or smart rendering is only for XML ?
Thank you
Answer posted by dhxSupport on Aug 31, 2009 01:53
Smart rendering works with any loading types. To enable smart rendering mode you just need to add mygrid.enableSmartRendering(true); to the grid inititalization.
Answer posted on Sep 09, 2009 20:42
Yes i have enable  mygrid.enableSmartRendering(true), but seem always loading a full csv instead by part, below are my code, i set to launch 10 row at first loading, something not correct ?

 <script src="codebase/dhtmlxcommon.js"></script>
  <script src="codebase/dhtmlxgrid.js"></script>
  <script src="codebase/dhtmlxgridcell.js"></script>
  <script src="codebase/dhtmlxgrid_filter.js"></script>
  <script src="codebase/dhtmlxgrid_nxml.js"></script>
  <script src="codebase/dhtmlxgrid_srnd.js"></script>
  <script>
    var mygrid;
    function doInitGrid(){
    mygrid = new dhtmlXGridObject('mygrid_container');
    mygrid.setImagePath("codebase/imgs/");
    mygrid.setHeader("A,B,C");
    mygrid.setInitWidths("100,100,100");
    mygrid.setSkin("light");
    mygrid.setColAlign("left,left,left");
    mygrid.setColSorting("str,str,str");
    mygrid.setColTypes("ro,ro,ro");
    mygrid.attachHeader("#select_filter,#text_filter,#text_filter");
    mygrid.enableResizing("false,false,false");
    mygrid.enableMultiline(true);
    mygrid.enableSmartRendering(true,10);
    mygrid.init();
    mygrid.load("mydata.csv","csv");
    }
  </script>
Answer posted on Sep 10, 2009 03:06
>> i set to launch 10 row at first loading, something not correct
When you are loading grid from static file all data loaded at once. Please check this tutorial about smart rendering http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:toc_dhtmlxgrid_step_by_step
Answer posted by Support on Sep 10, 2009 03:16
It will load full dateset ( because you are using static file for loading ) , but it will render only visible rows.
In you case smart rendering works in static mode, it loads full file, but renders only visible rows, so rendering time must be much lesser than in case without smart rendering.