packages/cf-tables/src/TableSortable.js
function updateTableData( columnIndex ) {
  let cell;
  const rows = this.ui.tableBody.querySelectorAll( 'tr' );
  this.tableData = [];
  columnIndex = columnIndex || this.sortColumnIndex;

  for ( let i = 0, len = rows.length; i < len; ++i ) {
    cell = rows[i].cells[columnIndex];
    if ( cell ) {
      cell = cell.textContent.trim();
    }
    this.tableData.push( [ cell, rows[i] ] );
  }

  const sortType = this.ui.sortButton.getAttribute( 'data-sort_type' );
  this.tableData.sort( this.tableDataSorter( this.sortDirection, sortType ) );

  return this.tableData;
}
function updateTableData( columnIndex ) {
  let cell;
  const rows = this.ui.tableBody.querySelectorAll( 'tr' );
  this.tableData = [];
  columnIndex = columnIndex || this.sortColumnIndex;

  for ( let i = 0, len = rows.length; i < len; ++i ) {
    cell = rows[i].cells[columnIndex];
    if ( cell ) {
      cell = cell.textContent.trim();
    }
    this.tableData.push( [ cell, rows[i] ] );
  }

  const sortType = this.ui.sortButton.getAttribute( 'data-sort_type' );
  this.tableData.sort( this.tableDataSorter( this.sortDirection, sortType ) );

  return this.tableData;
}
function updateTableData ( columnIndex ) { let cell ; const rows = this . ui . tableBody . querySelectorAll ( 'tr' ) ; this . tableData = [ ] ; columnIndex = columnIndex || this . sortColumnIndex ; for ( let i = 0 , len = rows . length ; i < len ; ++ i ) { cell = rows [ i ] . cells [ columnIndex ] ; if ( cell ) { cell = cell . textContent . trim ( ) ; } this . tableData . push ( [ cell , rows [ i ] ] ) ; } const sortType = this . ui . sortButton . getAttribute ( 'data-sort_type' ) ; this . tableData . sort ( this . tableDataSorter ( this . sortDirection , sortType ) ) ; return this . tableData ; }
Function used to get, sort, and update the table data array.

@param {number} columnIndex - The index of the column used for sorting.
@returns {Array} Multidimensional array of column's cell value
and corresponding row element.
Function used to get sort and update the table data array .