docs: def save_grid_data(self):
          """
          Save grid data in the data object
          """
          if not self.grid.changes:
              print('-I- No changes to save')
              return
  
          if self.grid_type == 'age':
              age_data_type = self.er_magic.age_type
              self.er_magic.write_ages = True
  
          starred_cols = self.grid.remove_starred_labels()
  
          self.grid.SaveEditControlValue() # locks in value in cell currently edited
  
          if self.grid.changes:
              num_cols = self.grid.GetNumberCols()
  
              for change in self.grid.changes:
                  if change == -1:
                      continue
                  else:
                      old_item = self.grid.row_items[change]
                      new_item_name = self.grid.GetCellValue(change, 0)
                      new_er_data = {}
                      new_pmag_data = {}
                      er_header = self.grid_headers[self.grid_type]['er'][0]
                      pmag_header = self.grid_headers[self.grid_type]['pmag'][0]
                      start_num = 2 if self.parent_type else 1
                      result_data = {}
  
                      for col in range(start_num, num_cols):
                          col_label = str(self.grid.GetColLabelValue(col))
                          value = str(self.grid.GetCellValue(change, col))
                          #new_data[col_label] = value
                          if value == '\t':
                              value = ''
  
                          if '++' in col_label:
                              col_name = col_label[:-2]
                              new_pmag_data[col_name] = value
                              continue
  
                          # pmag_* files are new interpretations, so should only have "This study"
                          # er_* files can have multiple citations
                          if col_label == 'er_citation_names':
                              new_pmag_data[col_label] = 'This study'
                              new_er_data[col_label] = value
                              continue
  
                          if er_header and (col_label in er_header):
                              new_er_data[col_label] = value
  
                          if self.grid_type in ('specimen', 'sample', 'site'):
                              if pmag_header and (col_label in pmag_header) and (col_label not in self.er_magic.double):
                                  new_pmag_data[col_label] = value
                          else:
                              if pmag_header and (col_label in pmag_header):
                                  new_pmag_data[col_label] = value
  
                          if col_label in ('er_specimen_names', 'er_sample_names',
                                           'er_site_names', 'er_location_names'):
                              result_data[col_label] = value
  
                      # if there is an item in the data, get its name
                      if isinstance(old_item, str):
                          old_item_name = None
                      else:
                          old_item_name = self.grid.row_items[change].name
  
                      if self.parent_type:
                          new_parent_name = self.grid.GetCellValue(change, 1)
                      else:
                          new_parent_name = ''
  
                      # create a new item
                      if new_item_name and not old_item_name:
                          print('-I- make new item named', new_item_name)
                          if self.grid_type == 'result':
                              specs, samps, sites, locs = self.get_result_children(result_data)
                              item = self.er_magic.add_result(new_item_name, specs, samps, sites,
                                                              locs, new_pmag_data)
                          else:
                              item = self.er_magic.add_methods[self.grid_type](new_item_name, new_parent_name,
                                                                               new_er_data, new_pmag_data)
  
                      # update an existing item
                      elif new_item_name and old_item_name:
                          print('-I- update existing {} formerly named {} to {}'.format(self.grid_type,
                                                                                    old_item_name,
                                                                                    new_item_name))
                          if self.grid_type == 'result':
                              specs, samps, sites, locs = self.get_result_children(result_data)
                              item = self.er_magic.update_methods['result'](old_item_name, new_item_name,
                                                                            new_er_data=None,
                                                                            new_pmag_data=new_pmag_data,
                                                                            spec_names=specs,
                                                                            samp_names=samps,
                                                                            site_names=sites,
                                                                            loc_names=locs,
                                                                            replace_data=True)
                          elif self.grid_type == 'age':
                              item_type = age_data_type
                              item = self.er_magic.update_methods['age'](old_item_name, new_er_data,
                                                                         item_type, replace_data=True)
  
                          else:
                              item = self.er_magic.update_methods[self.grid_type](old_item_name, new_item_name,
                                                                                  new_parent_name, new_er_data,
                                                                                  new_pmag_data, replace_data=True)