Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Latest commit

 

History

History
65 lines (49 loc) · 1.27 KB

v-columns.md

File metadata and controls

65 lines (49 loc) · 1.27 KB

v-columns

Binding columns with array, instead of using html

v-columns.bind="myColumns"

App.js

import { GridConnector } from 'aurelia-v-grid';
import { DataSource } from 'aurelia-v-grid';
import { Selection } from 'aurelia-v-grid';

export class App{

    constructor(){

        this.data =[
            {name:"Per"},
            {name:"Per"},
            {name:"Per"}]

        this.myColumns =[
            {colField:"name"}]    

        this.ds = new DataSource(new Selection('multiple'));
        this.gridConnector = new GridConnector(this.ds);
        this.ds.setArray(this.data );


    }


}

attribute that can be used:

  // ? = optional
  colWidth?: number;
  colRowTemplate?: string; (needs full html markup, see custom html)
  colHeaderTemplate?: string; (needs full html markup, see custom html)
  colField: string;
  colPinLeft?: boolean;
  colPinRight?: boolean;
  colHeaderName?: string;
  colAddLabelAttributes?: string;
  colAddFilterAttributes?: string;
  colAddRowAttributes?: string;
  colFilterMenu?: string;
  colLabelMenu?: string;
  colRowMenu?: string;
  colHidden?: boolean;
  colDragDrop?: string;
  colResizeable?: string;
  colSort?: string;
  colFilter?: string;
  colFilterTop?: boolean;
  colCss?: string;
  colType?: string;