Currency column

by FancyGrid Inc.

HTML

<script src="https://cdn.jsdelivr.net/npm/fancygrid/client/fancy.min.js"></script>

<div id="container"></div>

JavaScript

document.addEventListener("DOMContentLoaded", function() {


  new FancyGrid({
    title: 'Hour Rate - Currencies',
    renderTo: 'container',
    width: 752,
    height: 500,
    data: data,
    selModel: 'row',
    trackOver: true,
    theme: 'extra-gray',
    defaults: {
      type: 'string',
      width: 100,
      resizable: true,
      sortable: true,
      menu: ['size', '-', 'sort', '-', 'columns', '-', 'lock']
    },
    columns: [{
      index: 'name',
      title: 'Name'
    }, {
      type: 'string',
      index: 'country',
      title: 'Country'
    }, {
      index: 'hour',
      type: 'currency',
      title: 'Hour rate',
      width: 70
    }, {
      index: '12*180*hour',
      type: 'currency',
      title: 'Dollar',
      currency: Fancy.currency.USD,
      cellAlign: 'right',
      width: 70
    }, {
      index: '0.91*12*180*hour',
      type: 'currency',
      title: 'Euro',
      currency: Fancy.currency.EUR,
      cellAlign: 'right',
      render: function(o) {
        o.value = Fancy.Number.format(o.value, ',', 0);

        return o;
      },
      width: 90
    }, {
      index: '0.80*12*180*hour',
      type: 'currency',
      title: 'Pound',
      currency: Fancy.currency.GBP,
      cellAlign: 'right',
      render: function(o) {
        o.value = Fancy.Number.format(o.value, ',', 0);

        return o;
      },
      width: 90
    }, {
      index: '108.36*12*180*hour',
      type: 'currency',
      title: 'Yen',
      currency: Fancy.currency.JPY,
      cellAlign: 'right',
      render: function(o) {
        o.value = Fancy.Number.format(o.value, ',', 0);

        return o;
      },
      width: 90
    }, {
      index: '72*12*180*hour',
      type: 'currency',
      title: 'Ruble',
      currency: Fancy.currency.RUB,
      cellAlign: 'right',
      render: function(o) {
        o.value = Fancy.Number.format(o.value, ',', 0);

        return o;
      },
      width: 90
    }]
  });

});


var data = [{
    id: 1,
    name: 'Ted...