Export or serialze subgrids?

I am trying to export a grid. I have 4 levels of subgrids, and I want to either export the view on the screen (so if 2 levels are expanded I want to export it to look just like that), or export the lowest level that is expanded (so that if I have 2 levels - supervisor->employees and it is expanded to see employees for a supervisor, I want export all of the employees).

Are either of these options doable?

Thanks

There is no way to serialize or export main grid with subgrids. You can either serialize top level grid only, or any of sub-grids ( same for export )

Each of subgrids is fully functional grid instance, so you can use all api methods against them

var xml = grid.cells(id, 0).getSubgrid().serialize();