Veasy Angular Components
- Veasy Moment Format
- Veasy Calendar
- Veasy Datepicker (pending)
- Veasy Table
- Veasy Modal (pending)
- Veasy Input Search (pending)
angular-veasy-table
AngularJS directive to create quickly data tables without giving up the beauty and functionality.
Dependencies
Images

Instalation
$ bower install angular-veasy-table --save
In your angular app
angular.module('yourModule', ['veasy.table'])
.controller('yourController', function() {
$scope.config = {
id: 'my-specific-id',
columns: [
{
header: 'Id',
value: 'id',
dropdown: true,
default: 'Not Informed',
hideOn: 'xs',
filter: {
type: 'number',
fractionSize: 0
},
size: 5
},
{ header: 'First Name', value: 'first_name' },
{ header: 'Last Name', value: 'last_name', hideOn: 'xs' },
{ header: 'Email', value: 'email', hideOn: 'sm xs' },
{ header: 'Gender', value: 'gender', hideOn: 'sm xs' },
{ header: 'Money', value: 'money', hideOn: 'xs', filter: { type: 'currency', symbol: 'R$', fractionSize: 2 } },
{ header: 'Date', value: 'date', hideOn: 'lg md sm xs', filter: { type: 'date', format: 'dd/MM/yyyy HH:mm:ss' } }
]
};
});
In your HTML
<head>
<link rel="stylesheet" href="bower_components/angular-veasy-table/dist/css/veasy-table.min.css" media="screen" charset="utf-8"/>
</head>
<body>
...
<veasy-table list="items" config="config"></veasy-table>
...
<script src="bower_components/angular-veasy-table/dist/js/veasy-table-tpls.min.js" charset="utf-8"></script>
<script src="bower_components/angular-veasy-table/dist/js/veasy-table.min.js" charset="utf-8"></script>
</body>
Documentation
All of these configurations, you need put inside your config object, like '$scope.config'.
Enable toggle columns
toggleColumns: {
enable: true,
position: 'begin',
icons: {
opened: 'fa fa-chevron-down',
closed: 'fa fa-chevron-right'
}
}
contextMenu: {
enable: true,
icon: 'fa fa-ellipsis-v',
options: [
{
icon: 'fa fa-trash-o',
label: 'Delete',
action: function(row) {
...
alert('Your row has been deleted!');
}
}
]
}
pagination: {
enable: true,
currentPage: 0,
itemsPerPage: 10,
}
Enable data filter
filter: {
enable: true,
conditional: true,
isCaseSensitive: false,
ignoreSpecialCharacters: true,
delay: 300
}
Enable column filter (show and hide columns)
columnFilter: {
enable: true,
modalOptions: {
size: 'md',
autoOpen: false,
keyboard: true,
backdrop: true
}
}
Enable click row
clickRow: {
enable: true
}
Enable checkboxes
checkbox: {
enable: true,
}
Enable column sort
sort: {
enable: true
}
Enable translate
labels: {
filter: {
by: 'Filtrar por...',
all: 'Todas',
and: 'E',
or: 'OU'
},
pagination: {
itemsPerPage: 'Itens por Página',
totalItems: 'Total de Itens'
},
modal: {
title: 'Quais colunas você deseja exibir?',
okButton: 'Aplicar',
cancelButton: 'Cancelar'
}
}
Enable Events
All of veasy-table events are use $emit, and to listen these events you need to use $on
Click
$scope.$on('veasyTable:onClickRow', function(event, data) {
console.log('Some row was clicked', data);
});
Selected Items
$scope.$on('veasyTable:selectedItems', function(event, data) {
console.log('Some items were selected', data);
});
Column filter
$scope.$on('veasyTable:onApplyColumnFilter', function(event, data) {
console.log('Some columns was applied', data);
});
$scope.$on('veasyTable:onStartPagination', function(event) {
console.log('Pagination event was started');
});
$scope.$on('veasyTable:onEndPagination', function(event) {
console.log('Pagination event was done');
});
Search
$scope.$on('veasyTable:onStartSearch', function(event) {
console.log('Search event was started');
});
$scope.$on('veasyTable:onEndSearch', function(event) {
console.log('Search event was done');
});
Sort
$scope.$on('veasyTable:onStartSort', function(event) {
console.log('Sort event was started');
});
$scope.$on('veasyTable:onEndSort', function(event) {
console.log('Sort event was done');
});
Enable angular $filter at columns?
All of these configurations, you need put inside your target column, in your $scope.config object.
filter: {
name: 'currency',
symbol: 'R$',
fractionSize: 0
}
filter: {
name: 'date',
format: 'dd/MM/yyyy HH:mm:ss',
timezone: ''
}
filter: {
name: 'json',
spacing: 2
}
filter: {
name: 'number',
fractionSize: 2
}
filter: {
name: 'limitTo',
limit: 10,
begin: 0
}
filter: {
name: 'lowercase'
}
filter: {
name: 'uppercase'
}
Url
filter: {
name: 'url',
text: '',
target: '_blank'
}
Migrating from 1.x.x to 2.x.x version
In your HTML:
Just remove the 'selected-items' property
<veasy-table config="config" list="resultList" selected-items="selectedItems"></veasy-table>
<veasy-table config="config" list="resultList"></veasy-table>
In your Angular app:
On your app dependencies, just replace 'veasyTable' to 'veasy.table'.
angular.module('yourModule', [ 'veasyTable' ]);
angular.module('yourModule', [ 'veasy.table' ]);
On columns config, just remove 'size' and 'show' properties.
columns: [
{
header: 'Id',
value: 'id',
size: 5
}
]
columns: [
{
header: 'Id',
value: 'id',
size: 5,
hideOn: 'lg md sm xs',
filter: { type: 'number', fractionSize: 0 }
}
]
On checkbox config, just remove 'size' property.
checkbox: {
enable: true
}
checkbox: {
enable: true
}
On columnFilter config, just:
1 - Move 'autoOpen' property to inside of new property named 'modalOptions'.
2 - Move 'modalSize' property to inside of new property named 'modalOptions' and rename to 'size'.
columnFilter: {
enable: true,
}
columnFilter: {
enable: true,
modalOptions: {
size: 'md',
autoOpen: false,
keyboard: true,
backdrop: true
}
}
On resizable config, just remove.
On translation config, just:
1 - Rename 'translate' property to 'labels'.
2 - Add 'all' property inside 'filter' object.
4 - Rename 'columnFilter' property to 'modal'.
translate: {
filter: {
by: 'Filtrar por...',
and: 'E',
or: 'OU'
},
pagination: {
itemsByPage: 'Itens por Página',
totalItems: 'Total de Itens'
},
columnFilter: {
title: 'Quais colunas você deseja exibir?',
okButton: 'Ok',
cancelButton: 'Cancelar'
}
}
labels: {
filter: {
by: 'Filtrar por...',
all: 'Todas',
and: 'E',
or: 'OU'
},
pagination: {
itemsPerPage: 'Itens por Página',
totalItems: 'Total de Itens'
},
modal: {
title: 'Quais colunas você deseja exibir?',
okButton: 'Aplicar',
cancelButton: 'Cancelar'
}
}
On events config, just remove, because now, all events use $emit, and to listen these events you need to use $on.
$scope.$on('veasyTable:onClickRow', function(event, data) {
console.log('Some row was clicked', data);
});
$scope.$on('veasyTable:onApplyColumnFilter', function(event, data) {
console.log('Some columns was applied', data);
});