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.