How to serialize selected rows in grid?

I am trying to serialize only the selected/marked rows in my grid, but it doesn’t work. Any suggestions please.

myGrid.setSerializationLevel(true, true, true, true, false, false);

/*
userData - enable/disable user data serialization
selectedAttr - include “selected” row’s attribute in result XML
config - serialize grid configuration (only information about grid structure)
changedAttr - include “changed” cell’s attribute in result XML
onlyChanged - include only changed rows in result XML
asCDATA - output cell values as CDATA sections (prevent invalid XML)
*/

Does the 2nd parameter above manages this? Or any other dependent parameters?

This parameter includes “selected” attribute in xml, not serializes the selected rows only.

You can use inner API

var xml = grid._serializeRow(grid.render_row(index));

to generate xml for some rows only.