How to use the tubular-common.ColumnModel 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
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
  }),
  new ColumnModel('ShipperCity'),
  new ColumnModel('Amount', { DataType: ColumnDataType.NUMERIC })
];

export { validColumnsSample };
github unosquare / tubular-react / test / utils / mockContext.ts View on Github external
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: [
      [1, 'Microsoft', '2016-03-19T19:00:00', 'Guadalajara, JAL, Mexico', 300],
      [2, 'Microsoft', '2016-04-23T10:00:00', 'Guadalajara, JAL, Mexico', 0],
      [3, 'Microsoft', '2016-12-22T08:00:00', 'Guadalajara, JAL, Mexico', 300],
      [4, 'Unosquare LLC', '2016-02-01T18:00:00', 'Los Angeles, CA, USA', 0],
      [5, 'Microsoft', '2016-11-10T18:00:00', 'Guadalajara, JAL, Mexico', 92],
      [6, 'Unosquare LLC', '2016-11-06T18:00:00', 'Los Angeles, CA, USA', 18],
      [7, 'Unosquare LLC', '2016-11-11T18:00:00', 'Leon, GTO, Mexico', 50],
      [8, 'Unosquare LLC', '2016-11-08T18:00:00', 'Portland, OR, USA', 9],
      [9, 'Vesta', '2016-11-07T18:00:00', 'Guadalajara, JAL, Mexico', 108],
      [10, 'Unosquare LLC', '2016-11-05T18:00:00', 'Portland, OR, USA', 15],
    ],
    filteredRecordCount: 10,
    isLoading: false,
github unosquare / tubular-react / test / utils / mockContext.ts View on Github external
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: [
      [1, 'Microsoft', '2016-03-19T19:00:00', 'Guadalajara, JAL, Mexico', 300],
      [2, 'Microsoft', '2016-04-23T10:00:00', 'Guadalajara, JAL, Mexico', 0],
      [3, 'Microsoft', '2016-12-22T08:00:00', 'Guadalajara, JAL, Mexico', 300],
      [4, 'Unosquare LLC', '2016-02-01T18:00:00', 'Los Angeles, CA, USA', 0],
      [5, 'Microsoft', '2016-11-10T18:00:00', 'Guadalajara, JAL, Mexico', 92],
      [6, 'Unosquare LLC', '2016-11-06T18:00:00', 'Los Angeles, CA, USA', 18],
      [7, 'Unosquare LLC', '2016-11-11T18:00:00', 'Leon, GTO, Mexico', 50],
      [8, 'Unosquare LLC', '2016-11-08T18:00:00', 'Portland, OR, USA', 9],
      [9, 'Vesta', '2016-11-07T18:00:00', 'Guadalajara, JAL, Mexico', 108],
github unosquare / tubular-react / test / utils / mockContext.ts View on Github external
} from 'tubular-common';

const context = {
  actions: {
    exportTo: jest.fn(),
    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,
github unosquare / tubular-react / sample / src / data / columns.ts View on Github external
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', {
    DataType: ColumnDataType.NUMERIC,
    Sortable: true,
  }),
  new ColumnModel('IsShipped', {
    DataType: ColumnDataType.BOOLEAN,
    Filterable: true,
    Sortable: true,
  }),
];
export default columns;
github unosquare / tubular-react / sample / src / data / columns.ts View on Github external
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', {
    DataType: ColumnDataType.NUMERIC,
    Sortable: true,
  }),
  new ColumnModel('IsShipped', {
github unosquare / tubular-react / sample / src / data / columns.ts View on Github external
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', {
    DataType: ColumnDataType.NUMERIC,
    Sortable: true,
  }),
  new ColumnModel('IsShipped', {
    DataType: ColumnDataType.BOOLEAN,
    Filterable: true,
    Sortable: true,
  }),
];
export default columns;
github unosquare / tubular-react / srcdocs / utils / columns.ts View on Github external
import {
  ColumnDataType,
  ColumnModel,
} from 'tubular-common';

const columns = [
  new ColumnModel('OrderID', {
    DataType: ColumnDataType.NUMERIC,
    IsKey: true,
    Label: 'Id',
  }),
  new ColumnModel('CustomerName'),
  new ColumnModel('ShippedDate', {
    DataType: ColumnDataType.DATE_TIME,
  }),
  new ColumnModel('ShipperCity'),
  new ColumnModel('Amount', {
    DataType: ColumnDataType.NUMERIC,
  }),
  new ColumnModel('IsShipped', {
    DataType: ColumnDataType.BOOLEAN,
  }),
];
export default columns;
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,
github unosquare / tubular-react / srcdocs / utils / columns.ts View on Github external
import {
  ColumnDataType,
  ColumnModel,
} from 'tubular-common';

const columns = [
  new ColumnModel('OrderID', {
    DataType: ColumnDataType.NUMERIC,
    IsKey: true,
    Label: 'Id',
  }),
  new ColumnModel('CustomerName'),
  new ColumnModel('ShippedDate', {
    DataType: ColumnDataType.DATE_TIME,
  }),
  new ColumnModel('ShipperCity'),
  new ColumnModel('Amount', {
    DataType: ColumnDataType.NUMERIC,
  }),
  new ColumnModel('IsShipped', {
    DataType: ColumnDataType.BOOLEAN,
  }),
];
export default columns;