2150 |
mathias |
1 |
// example sample data and code
|
|
|
2 |
(function(){
|
|
|
3 |
// some sample data
|
|
|
4 |
// global var "data"
|
|
|
5 |
data = [
|
|
|
6 |
[ "normal", false, "new", 'But are not followed by two hexadecimal', 29.91, 10, false ],
|
|
|
7 |
[ "important", false, "new", 'Because a % sign always indicates', 9.33, -5, false ],
|
|
|
8 |
[ "important", false, "read", 'Signs can be selectively', 19.34, 0, true ],
|
|
|
9 |
[ "note", false, "read", 'However the reserved characters', 15.63, 0, true ],
|
|
|
10 |
[ "normal", false, "replied", 'It is therefore necessary', 24.22, 5.50, true ],
|
|
|
11 |
[ "important", false, "replied", 'To problems of corruption by', 9.12, -3, true ],
|
|
|
12 |
[ "note", false, "replied", 'Which would simply be awkward in', 12.15, -4, false ]
|
|
|
13 |
];
|
|
|
14 |
var rows = 100;
|
|
|
15 |
for(var i=0, l=data.length; i<rows-l; i++){
|
|
|
16 |
data.push(data[i%l].slice(0));
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
// global var "model"
|
|
|
20 |
model = new dojox.grid.data.Table(null, data);
|
|
|
21 |
|
|
|
22 |
// simple display of row info; based on model observation
|
|
|
23 |
// global var "modelChange"
|
|
|
24 |
modelChange = function(){
|
|
|
25 |
var n = dojo.byId('rowCount');
|
|
|
26 |
if(n){
|
|
|
27 |
n.innerHTML = Number(model.getRowCount()) + ' row(s)';
|
|
|
28 |
}
|
|
|
29 |
}
|
|
|
30 |
})();
|