forked from courajs/ember-table-scroll-issue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
56 lines (47 loc) · 1.21 KB
/
app.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
window.App = Ember.Application.create({
LOG_TRANSITIONS: true
});
var columns = [
Ember.Table.ColumnDefinition.create({
columnWidth: 500,
headerCellName: 'ID',
contentPath: 'id'
}),
Ember.Table.ColumnDefinition.create({
columnWidth: 500,
headerCellName: 'Letter',
contentPath: 'letter'
}),
Ember.Table.ColumnDefinition.create({
columnWidth: 500,
headerCellName: 'Percent',
contentPath: 'number'
}),
Ember.Table.ColumnDefinition.create({
columnWidth: 500,
headerCellName: 'Now',
contentPath: 'date'
})];
var stuff = [];
var letters = 'abcdefghijklmnopqrstuvwxyz'.split('');
function generate_row(id){
return {
id: id,
letter: random_element(letters),
number: Math.ceil(Math.random() * 100),
date: new Date()
};
function random_element(ary){
var len = ary.length;
var index = Math.floor(Math.random() * len);
return ary[index];
}
}
for (var i = 0; i < 100; i++){
stuff.push(generate_row(i));
}
App.ApplicationController = Ember.ObjectController.extend({
showDetails: false,
things: columns,
stuff: stuff
});