2.20220428.1 • Published 2 years ago

@xbim/grid v2.20220428.1

Weekly downloads
24
License
-
Repository
-
Last release
2 years ago

xbim Flex grid

The xbim Flex grid provides a grid component based on the Material table that can be bound to the flex state management service.

Usage

import { AssetModelEntityState, EntityComparer } from '@xbim/flex-webkit';}

@Component({
  selector: 'app-yourTeamlist',
  template: `<flex-table
    [stateType]="stateType"
    [displayedColumns]="orderedColumns"
    [columnDefinitions]="definedColumns"
    (rowSelected)="previewModel($event)"
    (rowDblClick)="openModel($event)"
    [comparer]="comparer"
    allowMultipleSelection="true"
    ></flex-table>`
})
export class ModelListComponent {

  constructor() { }

  // The NGXS state to bind the grid to
  public stateType = AssetModelEntityState;
  public comparer = new EntityComparer();

  // define the column meta data
  definedColumns: GridColumnDefinition[] = [
    {
      id: 'Name',
      title: 'Model Name',
      isPrimary: true,
      prefixIcon: 'document'
    },
    {
      id: 'Revision',
      title: 'Email',
    },
    {
      id: 'ModelSize',
      title: 'Bytes'
    },
    {
      id: 'DateUploaded',
      title: 'Uploaded'
    }
  ];

  // define the visible columns
  orderedColumns = ['Name', 'Revision', 'ModelSize'];

  openModel(row: AssetModel) {
    // Navigate to model
    console.log('Open', row);
    // e.g.
    // this.store.dispatch([
    //   new SetActive(AssetModelEntityState, row.AssetModelId),
    //   new Navigate(['../viewer'], null, { relativeTo: this.route })
    // ]);
  }

  previewModel(row: AssetModel) {
      console.log('Preview', row);
  }
}
2.20220317.1

2 years ago

2.20220428.1

2 years ago

2.20220109.3

2 years ago

1.20220109.2

2 years ago

1.20210712.1

3 years ago

1.20210712.5

3 years ago

1.20210711.5

3 years ago

1.20210624.2

3 years ago

1.20210211.4

3 years ago

1.20210122.2

3 years ago

1.20201112.1

3 years ago

1.20200929.2

4 years ago

1.20200911.1

4 years ago

1.20200818.4

4 years ago

1.20200812.1

4 years ago

1.20200811.3

4 years ago

1.20200808.1

4 years ago

1.20200807.7

4 years ago

1.20200807.6

4 years ago