It could be done by using a unique Id field ( dataModel.recIndx ) to identify rows.
The expanded state of rows is stored as boolean value in rowData.pq_detail.show
1.) In getData() callback, store the expanded state of existing rows (dataModel.data) in an object against unique id of rows.
{ id1: true, id2: false,..... }
and pass on the rowData.pq_detail.show value to corresponding new rows in response.