-
Notifications
You must be signed in to change notification settings - Fork 350
/
ajax.js
33 lines (31 loc) · 927 Bytes
/
ajax.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// BEGIN-SNIPPET ajax-controller
import Ember from 'ember';
import ColumnDefinition from 'ember-table/models/column-definition';
import AjaxTableLazyDataSource from
'../views/ajax-table-lazy-data-source';
export default Ember.Controller.extend({
tableColumns: Ember.computed(function() {
var avatar = ColumnDefinition.create({
savedWidth: 80,
headerCellName: 'avatar',
tableCellViewClass: 'ajax-image-table-cell',
contentPath: 'avatar'
});
var columnNames = ['login', 'type', 'createdAt'];
var columns = columnNames.map(function(key) {
return ColumnDefinition.create({
savedWidth: 150,
headerCellName: key.w(),
contentPath: key
});
});
columns.unshift(avatar);
return columns;
}),
tableContent: Ember.computed(function() {
return AjaxTableLazyDataSource.create({
content: new Array(100)
});
})
});
// END-SNIPPET