How to use the react-virtualized.SortDirection.ASC function in react-virtualized

To help you get started, we’ve selected a few react-virtualized examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github studentinsights / studentinsights / app / assets / javascripts / levels / LevelsView.js View on Github external
function initialState() {
  return {
    search: '',
    grade: ALL,
    englishProficiency: ALL,
    house: ALL,
    counselor: ALL,
    level: ALL,
    trigger: ALL,
    sortBy: 'level',
    sortDirection: SortDirection.ASC,
    isDownloadOpen: false
  };
}
github Netflix / vizceral-example / src / components / connectionList.jsx View on Github external
classNames.push(`color-${connection.class}`);
      }

      return {
        name: this.props.direction === 'incoming' ? connection.source.getName() : connection.target.getName(),
        errorRate: errors / total || 0,
        errors: errors,
        total: total,
        className: classNames.join(' '),
        disabled: disabled,
        notices: connection.notices
      };
    });

    connectionRows.sort(sorters[this.state.sortBy]);
    if (this.state.sortDirection !== SortDirection.ASC) { _.reverse(connectionRows); }

    if (this.refs.flexTable && this.refs.flexTable.props.estimatedRowSize) {
      estimatedRowHeight = this.refs.flexTable.props.estimatedRowSize - 4;
    }
    const tableHeight = Math.min(maxTableHeight, (estimatedRowHeight * connectionRows.length) + headerHeight);


    return (
      connectionRows.length > 0
        ? <div>
          </div>
github CyberReboot / vent / vent / extras / vizceral / src / components / subNodeList.jsx View on Github external
constructor (props) {
    super(props);
    this.state = {
      nodes: props.nodes,
      sortBy: 'totalPercent',
      sortDirection: SortDirection.ASC
    };

    this.linkPopover = (node) =&gt; {
      const atlasBackend = this.props.region ? `&amp;backend=http:%2F%2Fatlas-main.${this.props.region}.prod.netflix.net:7001` : '';
      const atlasLink = `http://atlasui.prod.netflix.net/ui/graph?g.q=nf.cluster,${node.name},:eq,name,RequestStats-all-requests-_Num,:re,:and,:sum,(,name,),:by&amp;g.e=now-1m&amp;g.s=e-3h&amp;g.tz=US%2FPacific&amp;mode=png&amp;vsplit=520px&amp;sel=expr.0.0${atlasBackend}`;
      const spinnakerRegion = this.props.region ? `®=${this.props.region}` : '';
      const spinnakerLink = `https://spinnaker.prod.netflix.net/#/applications/${node.app}/clusters?acct=prod&amp;q=cluster:${node.name}${spinnakerRegion}`;
      return (
        
          <div>OPEN IN</div>
          <div><a href="{atlasLink}">Atlas UI</a></div>
          <div><a href="{spinnakerLink}">Spinnaker</a></div>
        
      );
    };
github gnestor / jupyterlab_table / component / virtualized-table.js View on Github external
function getState(props: Props) {
  const data = props.data;
  const schema = props.schema || inferSchema(data);
  return {
    data,
    schema
  };
}

export default class VirtualizedTable extends React.Component {
  props: Props;
  state: State = {
    data: [],
    schema: { fields: [] },
    sortBy: '',
    sortDirection: SortDirection.ASC
  };

  componentWillMount() {
    const state = getState(this.props);
    this.setState(state);
  }

  componentWillReceiveProps(nextProps: Props) {
    const state = getState(nextProps);
    this.setState(state);
  }

  render() {
    const rowCount = this.state.data.length + 1;
    const height = rowCount * ROW_HEIGHT;
    return (
github MCS-Lite / mcs-lite / packages / mcs-lite-admin-web / src / containers / User / Table.js View on Github external
constructor(props) {
    super(props);
    this.state = {
      sortDirection: SortDirection.ASC,
      sortBy: 'userName',
      sortedList: props.data,
    };
  }
github spinnaker / deck / app / scripts / modules / core / src / pagerDuty / Pager.tsx View on Github external
constructor(props: IPagerProps) {
    super(props);

    const { $stateParams } = ReactInjector;
    this.state = {
      accountName: (SETTINGS.pagerDuty && SETTINGS.pagerDuty.accountName) || '',
      app: $stateParams.app || '',
      filterString: $stateParams.q || '',
      hideNoApps: $stateParams.hideNoApps || false,
      notFoundApps: [],
      initialKeys: $stateParams.keys || [],
      sortBy: $stateParams.by || 'service',
      sortDirection: $stateParams.direction || SortDirection.ASC,
      sortedData: [],
      selectedKeys: new Map(),
    };
  }
github Netflix / vizceral-example / src / components / connectionList.jsx View on Github external
constructor (props) {
    super(props);
    this.state = {
      connections: props.connections,
      sortBy: 'errorRate',
      sortDirection: SortDirection.ASC
    };
  }
github OpusCapita / filemanager / packages / client-react / src / client / components / ListView / ListView.react.js View on Github external
onScroll: PropTypes.func,
  onSelection: PropTypes.func,
  onSort: PropTypes.func,
  onKeyDown: PropTypes.func,
  onRef: PropTypes.func
};
const defaultProps = {
  rowContextMenuId: nanoid(),
  filesViewContextMenuId: nanoid(),
  items: [],
  layout: () => [],
  layoutOptions: {},
  selection: [],
  loading: false,
  sortBy: 'title',
  sortDirection: SortDirection.ASC,
  onRowClick: () => {},
  onRowRightClick: () => {},
  onRowDoubleClick: () => {},
  onScroll: () => {},
  onSelection: () => {},
  onSort: () => {},
  onKeyDown: () => {},
  onRef: () => {}
};

export default
class ListView extends Component {
  state = {
    scrollToIndex: 0,
    clientHeight: 0,
    scrollTop: 0,
github studentinsights / studentinsights / app / assets / javascripts / transitions / TransitionsPage.js View on Github external
onTableSort({defaultSortDirection, event, sortBy, sortDirection}) {
    if (sortBy === this.state.sortBy) {
      const oppositeSortDirection = (this.state.sortDirection == SortDirection.DESC)
        ? SortDirection.ASC
        : SortDirection.DESC;
      this.setState({ sortDirection: oppositeSortDirection });
    } else {
      this.setState({sortBy});
    }
  }