Docs
API
  • setColumns(columns: Array)

    Set new columns for grid.

    For proper work it is recommended to set id-s or unique data indexes for columns.

    Example:

    
    var grid = new FancyGrid({
      ...
    ...
    grid.setColumns([
      type: 'select'
    },{
      type: 'rowdrag'
    },{
      title: 'Company',
      index: 'company',
      type: 'string',
      autoWidth: true
    },{
      title: 'Price',
      index: 'price'
    },{
      title: 'Change',
      index: 'change'
    },{
      title: '% Change',
      index: 'pctChange'
    },{
      title: 'Last Updated',
      index: 'lastChange',
      type: 'string',
      width: 150
    },{
      title: 'Company + Price',
      id: 'companyPrice',
      render: function(o){
        o.value = o.data.company + ' ' + o.data.price;
        
        return o;
      }
    }]);