manipulate the grid and subgrids

Hello! Thanks for everything! I am using a grid with subgrid, it works, but I don’t know which functions should I use to manipulate the grid and subgrids.
TIA

You can open|close subgrid by
    grid.cells(i,j).open()
    grid.cells(i,j).close()

where i,j - coordinates of related cell

Also you can get subgrid object and use any API calls
    var sub = grid.cells(i,j).getSubGrid();
    sub.serialize();