Grid.addRow: Uncaught RangeError: Maximum call stack size ex

Hi all,

…I would appreciate if someone could guide me a bit - whenever I try a addRow on a grid, I get an “Uncaught RangeError: Maximum call stack size exceeded in dhtmlx.js 9”. Below the easiest smallest cut of code - just init the grid and addRow throws the error. Most of the code is just straight copied from examples and without addRow, it works fine:

	var grid_1 = a.attachGrid();
	grid_1.setIconsPath('./codebase/imgs/');
	// ****************************************************************** Grid col config
	grid_1.setColumnIds("c1,c2");
	grid_1.setHeader(["Stat.","C1"]);
	grid_1.setColTypes("ed,ed");
	grid_1.setInitWidths('70,70');
	// ******************************************************************
	grid_1.init();		
	grid_1.addRow(grid_1.uid(),["1","2"],1);  >>>>>>>>>>>>>>>>Throws the error

Anybody has maybe any suggestion why this is not working ? Any feedback very much appreciated,
thanks so much,
Frank

Please, try to use:
grid_1.addRow(grid_1.uid(),[“1”,“2”],0);
as the row index should be zero-based.

Hello, sematik,
…thanks so much for your support, I did the change for the index to 0, but the same error still occurs…anyone any other suggestions ?
Thanks so much,
best wishes,
Frank

Unfortunately the issue cannot be reproduced locally.
Could you please, provide with a complete demo, where the problem can be reconstructed.
Here you can find a tutorial about creating a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

Hello, Sematik,

…thanks a lot for coming back, please find the full demo, reduced to the error producing code, at:

fendrikat.com/apm/indexerr.html

Uncaught RangeError: Maximum call stack size exceeded dhtmlx.js:9

The error occurs because of the grid.addRow statement in src/adm/err_imex.js in line 39:

Any help and support on this very much appreciated,

all the best,

Frank

On your page you are including the “dhtmlx.js” and after that you a re including also the individual ja libraries.

In case of using the “dhtmlx.js” there is no need to attach other components libraries all they are included in dhtmlx.js.

Please, try to remove the following:

<script src="codebase/dhtmlxcommon.js" type="text/javascript"></script> <script src="codebase/dhtmlxtoolbar.js" type="text/javascript"></script> <script src="codebase/dhtmlxtree.js" type="text/javascript"></script> <script src="codebase/dhtmlxtreegrid.js" type="text/javascript"></script> <script src="codebase/dhtmlxgrid_excell_sub_row.js" type="text/javascript"></script> <script src="codebase/ext/dhtmlxform_item_btn2state.js" type="text/javascript"></script> <script src="codebase/dhtmlxgrid_nxml.js" type="text/javascript"></script>