title: Ag-Grid: How to save and reload column order
body: <p>Using Ag-Grid, users can drag columns to order them the way they like.  I need to allow the user to save their column order (to an SQL backend) so that it becomes the default column order for them. I was trying to get the column names like this:</p>
  
  <pre><code>var cols = schedGridOptions.columnApi.getAllColumns();
  for (col in cols) {
      var colDef = col.getColDef();
      console.log(colDef.headerName);
  }
  </code></pre>
  
  <p>This was an example I found for setting the header name, so I tried to adapt it to getting the header name. But I get this error:</p>
  
  <blockquote>
    <p>JavaScript runtime error: Object doesn't support property or method
    'getColDef'</p>
  </blockquote>
  
  <p>Perhaps I'm not doing this correctly? I'm fairly new at using Ag-Grid. Looking for suggestions.</p>