The 'getSelections' returns an array that contains the selected rows. You should convert it to string value. Please refer to the code below:
var rows = $('#grdTable').datagrid('getSelections');
var ids = $.map(rows, function(row){return row.id});
var str = join(',', ids);
console.log(str);