Subgrid error.... TypeError: myGrid.setSubGrid is not a function

I am trying to get subgrid to work for the first time on my project.
I have dhtmlxgrid.js Version: 5.2.0 Edition: Professional.
Also, I have dhtmlxgrid_excell_sub_row.js v.3.5 build 120731.
My code consists of:

var myGrid;
		function doOnLoad() {
			subGrid = new dhtmlXGridObject('gridbox_sub');
			subGrid.setImagePath("../../../codebase/imgs/");
			subGrid.setHeader("Name,UID,Total count");
			subGrid.setInitWidths("100,120,80");
			subGrid.enableAutoHeight(true);
			subGrid.setColTypes("ro,ro,ro");
			subGrid.init();
			subGrid.load("../common/authors.xml",function(){
				myGrid = new dhtmlXGridObject('gridbox');
				myGrid.setImagePath("../../../codebase/imgs/");
				myGrid.setHeader("Sales, Book Title, Author,Price,In Store,Shipping,Bestseller,Date of Publication");
				myGrid.setInitWidths("70,150,100,80,80,80,80,100");
				myGrid.setColAlign("right,left,left,right,center,left,center,center");
				myGrid.setColTypes("dyn,ed,grid,price,ch,co,ra,ro");
				myGrid.setSubGrid(subGrid,2,0);
				myGrid.enableAutoWidth(true);
				myGrid.enableAutoHeight(true);
				myGrid.init();
				myGrid.load("../common/grid_authors.xml");
			});
		}

which I copied (with some minor changes, the path for ex.) from:
https://dhtmlx.com/docs/products/dhtmlxGrid/samples/13_interaction_other_components/04_pro_linked_grid.html

However, when I run the page, I get TypeError: myGrid.setSubGrid is not a function.
I don’t know if I’m not using the proper pro files, or if there is a problem in my code.

Can you help?

Thank you.

I’ve made some progress. By looking at a separate example: Sub-grids DHTMLX Docs
I see that the needed column type is not “grid” but instead is “sub_row_grid”. Using that, I no longer have an error on column type. However, I still get the error of “setSubGrid is not a function”. "setSubGrid is used in the first example, above. However, it is not used in the second example, listed in this post. I think what I need is a more comprehensive example of using sub grid. Does anybody know where I can see such an example?
Thank you.

You need to attach the dhtmlxgrid_excell_grid.js to your app.
Here is a working sample of the “grid” usage:
https://dhtmlx.com/docs/products/dhtmlxGrid/samples/13_interaction_other_components/04_pro_linked_grid.html
If the problem still occurs for you please, provide a complete demo or a demo link, where the problem can be reconstructed locally.