retrieving dhtmlx control that's attached to a tab

I have an application where I create multiple tabs and each tab can have a dhtmlxgrid or a dhtmlxlayout attached. In addition, the dhtmlxlayout may have grids attached to it’s cells. Is there a way to get retrieve the grid that is attached to the tab so I can retrieve data from the Cells or other properties of the grid? Thank you for your assistance.

When you initialize grid, it object is created and you may access grid by this object.
Like
var grid = layout.cells(“a”).attachGrid();

Yes, I’m doing that now, but I’m also reusing that object to create the grid for the next tab. The user can open as many tabs as they want, each with their own grid. so insteading for creating an array and managing that, I was hoping to be able to just retrieve the grid from a given tab object. Is that possible?

Thanks

It is impossible to reuse the same grid in several tabs.

However, if you used “iframes” href mode and loaded html page with grid into tabs, you could use the same page for different tabs.

Well, I’m not trying to use the same grid in multiple tabs, just the same variable. Here is a summary of my code

tabbar.addTab(0, “Report 1”, “300px”);
dhxLayout = tabbar.cells(0).attachLayout(“1C”);
grid = dhxLayout.cells(“a”).attachGrid();

tabbar.addTab(1, “Report 2”, “300px”);
dhxLayout = tabbar.cells(1).attachLayout(“1C”);
grid = dhxLayout.cells(“a”).attachGrid();

After running the above code, I now want to access the cells in the grid on Tab 0. Is there a way to access them through a DHTMLX property or method? Or will I have to keep track of the grid variable in a javascript array? Any help is appreciated.

Or will I have to keep track of the grid variable in a javascript array?

it would be more correct. The 1st approach requires using private properties, there isn’t a public method