Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Raymond Linton on Jul 01, 2008 12:38
open dhtmlx forum
enableSmartRendering is not a function under dhtmlx 1.6

I am using the tutorial to help set up dhtmlxGrid with smart rendering since my database has over 7500 rows to pull information from. So far, everything up to this point has been very smooth, but as soon as I added the line to enable smart rendering, firebug began reporting this error.

Here is the code currently being used to initialize the grid:

<script type="text/javascript" language="javascript">
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxCalendar'.DS.'codebase'.DS.'dhtmlxcalendar.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxCalendar'.DS.'codebase'.DS.'dhtmlxcommon.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'ext'.DS.'dhtmlxgrid_srnd.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'dhtmlxgrid.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'dhtmlxgridcell.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'js'.DS.'addElement'.DS.'addElement.js'); ?>
</script>
<script type="text/javascript" language="javascript">
    var gridQString = "";//we'll save here the last url with query string we used for loading grid (see step 5 for details)
//we'll use this script block for functions
    
    var mygrid;
    function doInitGrid(){
    
     mygrid = new dhtmlXGridObject('mygrid_container');

        mygrid.setImagePath("/components/com_leonardo/dhtmlxSuite/dhtmlxGrid/codebase/imgs/");
    
        mygrid.setHeader("Food,kCalories,Protein,Carbohydrates");
    
        mygrid.setInitWidths("*,75,75,150");
    
        mygrid.setColAlign("left,right,right,right");
    
        mygrid.setSkin("light");
        
        mygrid.setColSorting("str,int,int,int");
        
        //mygrid.load("/components/com_leonardo/food_database.php","json");
    
        mygrid.init();
        
        mygrid.enableSmartRendering(true);
    }
</script>

As you can see, I've commented out the data import, but only to decrease load times while I fix this issue. The information loads properly when I comment the line back in.

I am using version 1.6 of the codebase, build 80603. I have checked other related topics in the knowledgebase and none have had solutions that work in my case.
Answer posted by Support on Jul 02, 2008 01:44
Please try to change order of files included, the dhtmlxgrid_srnd.js is an extension to grid functionality , so it must be loaded after dhtmlxgrid.js

    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxCalendar'.DS.'codebase'.DS.'dhtmlxcalendar.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxCalendar'.DS.'codebase'.DS.'dhtmlxcommon.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'dhtmlxgrid.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'dhtmlxgridcell.js'); ?>
    <?php echo file_get_contents(JPATH_COMPONENT.DS.'dhtmlxSuite'.DS.'dhtmlxGrid'.DS.'codebase'.DS.'ext'.DS.'dhtmlxgrid_srnd.js'); ?>

Answer posted by Raymond Linton on Jul 02, 2008 09:33
This worked perfectly.  I don't know why I didn't catch the order problem myself.