Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Owen on Aug 24, 2007 23:36
open dhtmlx forum
dhtmlxGrid _SCL Undefined with colspan

Hello,

I've run into an odd problem and I'm hoping you can help. When my tree grid initializes, I now get an error saying "Error: '_SCL' is null or not an object".

My script includes are organized as follows:

  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXCommon.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGridCell.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXTreeGrid.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_math.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_srnd.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_mcol.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_drag.js"></script>

My grid is initialized as follows:

   newgrid = new dhtmlXGridObject();
   var gObj = new Object();
   gObj.name = name;
   gObj.grid = window[newgrid];
   gridHash.push(gObj);
   newgrid.attachToObject(tgtObj);
   newgrid.selMultiRows = false;
   newgrid.imgURL = "_includes/dhtmlx/TreeGrid/imgs/";
   newgrid.setStyle("height:22px");
   newgrid.setSkin("xp");
   newgrid.setOnBeforeRowDeletedHandler(deleteListener);
   newgrid.setOnEditCellHandler(updateRowListener);
   newgrid.enableDragAndDrop(false);
   newgrid.enableAutoHeigth(false);
   newgrid.enableCollSpan(true);
   newgrid.loadXML('_modules/templates/psyop/psyactblue/getgriddata.cfm?gridName=ProductIndicator&rKey=' + ikey);

The code that loads the xml is written as follows:

   <row id="#IndicatorKey#" open="">
    <cell>#IndicatorKey#</cell>
    <cell/>
    <cell>#ReportKey#</cell>
    <cell>#XMLFormat(local.Indicatorcdata)#</cell>
    <cell>#XMLFormat(local.Indicatorsdata)#</cell>
    <cell>#XMLFormat(IndicatorSeries)#</cell>
    <cell image="folder.gif">Indicator</cell>
    <cell type="ro">#XMLFormat(local.iType)#</cell>
    <cell type="ed" colspan="7">#XMLFormat(Indicator)#</cell>
    <cell/>
    <cell/>
    <cell/>
    <cell/>
    <cell/>
    <cell/>
  </row>

If I remove the colspan="7" attribute, I don't get the error. Could this somehow be related to the order in which I include the js files?

Your assistance is greatly appreciated.

Owen

Answer posted by Stanislav on Sep 05, 2007 18:58
Seems that problem caused by "math" excell, which has some problems with colspans, if problem still actual for you - please contact us at dhtmlx@scand.com - I will provide latest version of "math" extension , which can solve problem.
Answer posted by Owen on Sep 05, 2007 23:06

I think I ran it to ground. A developer working on another part of the application had trouble getting some things to fire. He spot patched the issue by manually including the subordinate libraries as follows:

<script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_math.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_srnd.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_mcol.js"></script>
  <script  src="_includes/dhtmlx/TreeGrid/js/dhtmlXGrid_drag.js"></script>

When I removed these references from the common includes, my code worked again and the problem went away. However, his code broke again.

We're currently working to see why his code seemed to require the direct inclusion of the sub-libraries so that we can implement the dhtmlx libraries in a standard, consistent and correct fashion.

Regards,

Owen

Answer posted by Stanislav on Sep 06, 2007 16:14
The "_SCL" is a part of dhtmlxGrid_math.js, but it always used with checking and must not cause any issues on its own.
If version of dhtmlxGrid used in your case is not latest one - please contact us at dhtmlx@scand.com, I can provide a latest version of "math" extension, it has some fixes, which may resolve your problem.
Answer posted by Owen on Sep 20, 2007 21:50
For posterity, the problem was resolved by the updated math excell. Thanks for the support!