title: Custom function on table column reordering --> change underlying table model
body: <p>I use SheetJS to upload an excel sheet to a <code>ui.table</code>. While uploading I add a technical ID to my column names, which I will need later on in my project. This is how I am adding the technical ID:</p>
  
  <pre><code>getColumnNames: function(worksheet, aData) {
          var firstRow = aData[0];
          var oColumns = [];
          var cells = Object.keys(worksheet);
          for (var i = 0; i &lt; Object.keys(firstRow).length; i++) {            
              var columnName = Object.keys(firstRow)[i];
              var technicalName = "COL" + ('0' + (i+1)).slice(-2);
              oColumns.push({
                  columnId: columnName,
                  technicalId: technicalName
              });
          }
      return oColumns;
  },
  </code></pre>
  
  <p>When creating the Model, I bind both the <code>columnId</code> and the <code>technicalId</code> to each column.</p>
  
  <p>My users should have the option to reorder the table columns in order to do a mapping to another table. (Context here is not really relevant) So basically there is another table below my uploaded table and a user should be able to reorder the columns of the "uploadTable" to match them with the table below.</p>
  
  <p>Now in order to do a proper mapping, my technical ID has to be adjusted after the reordering is done. Therefore I'd like to add a function that's being executed after the user clicked a "refresh" button. </p>
  
  <p>This function should adjust the technical <code>columnNames</code>. --> E.g. data gets uploaded, column on position 1 has the technical ID "COL01" now it gets dragged to position 2 --> technical ID should change to COL02 and vice versa.</p>
  
  <p>I believe, the only way to do this is by accessing the DomRef of the table, because that's the only place where the actual current table structure is stored, but I'm not exactly sure how I would proceed.</p>
  
  <p>My reordering function only gets the data so far:</p>
  
  <pre><code>onReorder : function() {
      var table = this.getView().byId("uploadData");
      var currentStructre = table.getDomRef();
  },
  </code></pre>
  
  <p>I would appreciate any hints towards this. If anything is unclear, I'm happy to explain it!</p>