How to use the tubular-common.ColumnSortDirection.ASCENDING function in tubular-common

To help you get started, we’ve selected a few tubular-common 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 unosquare / tubular-react / test / utils / columns.ts View on Github external
import {
  AggregateFunctions,
  ColumnDataType,
  ColumnModel,
  ColumnSortDirection
} from 'tubular-common';

const regularOrderIdCol = new ColumnModel('OrderID', {
  DataType: ColumnDataType.NUMERIC,
  Filterable: true,
  IsKey: true,
  SortDirection: ColumnSortDirection.ASCENDING,
  SortOrder: 1,
  Sortable: true
});

// Column samples
const validColumnsSample = [
  regularOrderIdCol,
  new ColumnModel('CustomerName', {
    Aggregate: AggregateFunctions.COUNT,
    Filterable: true,
    Searchable: true
  }),
  new ColumnModel('ShippedDate', {
    DataType: ColumnDataType.DATE_TIME,
    Filterable: true
  }),
github unosquare / tubular-react / test / utils / mockContext.ts View on Github external
setActiveColumn: jest.fn().mockReturnValue('CustomerName'),
    setInitialData: jest.fn(),
    sortColumn: jest.fn().mockReturnValue('OrderID'),
    updatePage: jest.fn(),
    updateSearchText: jest.fn().mockReturnValue('search'),
  },
  state: {
    activeColumn: null,
    aggregate: null as any,
    columns: [
      new ColumnModel('OrderID', {
        DataType: ColumnDataType.NUMERIC,
        Filterable: true,
        IsKey: true,
        Label: 'Order ID',
        SortDirection: ColumnSortDirection.ASCENDING,
        SortOrder: 1,
        Sortable: true,
      }),
      new ColumnModel('CustomerName', {
        Aggregate: AggregateFunctions.COUNT,
        Filterable: true,
        Searchable: true,
      }),
      new ColumnModel('ShippedDate', {
        DataType: ColumnDataType.DATE_TIME,
        Filterable: true,
      }),
      new ColumnModel('ShipperCity'),
      new ColumnModel('Amount', { DataType: ColumnDataType.NUMERIC }),
    ],
    data: [
github unosquare / tubular-react / src / DataGrid / GridHeaderCell.tsx View on Github external
export const GridHeaderCell: React.FunctionComponent = ({
    column,
    sortColumn,
    setActiveColumn,
}: IGridHeaderCellProps) => {
    const sort = () => sortColumn(column.Name);
    const handleClick = (e: any) => setActiveColumn(column, e);

    const direction =
        column.SortDirection === ColumnSortDirection.ASCENDING || column.SortDirection === ColumnSortDirection.NONE
            ? 'asc'
            : 'desc';

    const render = column.Sortable ? (
        
            
                {column.Label}
github unosquare / tubular-react / sample / src / data / columns.ts View on Github external
import {
  AggregateFunctions,
  ColumnDataType,
  ColumnModel,
  ColumnSortDirection,
} from 'tubular-common';

const columns = [
  new ColumnModel('OrderID', {
    DataType: ColumnDataType.NUMERIC,
    Filterable: true,
    IsKey: true,
    Label: 'Id',
    SortDirection: ColumnSortDirection.ASCENDING,
    SortOrder: 1,
    Sortable: true,
  }),
  new ColumnModel('CustomerName', {
    Aggregate: AggregateFunctions.COUNT,
    Filterable: true,
    Searchable: true,
    Sortable: true,
  }),
  new ColumnModel('ShippedDate', {
    DataType: ColumnDataType.DATE_TIME,
    Filterable: true,
    Sortable: true,
  }),
  new ColumnModel('ShipperCity'),
  new ColumnModel('Amount', {