mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
add tests for jquery-handsontable
This commit is contained in:
parent
c3f5cd7864
commit
37d59baa6f
28
jquery-handsontable/jquery-handsontable-tests.ts
Normal file
28
jquery-handsontable/jquery-handsontable-tests.ts
Normal file
@ -0,0 +1,28 @@
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="jquery-handsontable.d.ts" />
|
||||
|
||||
var data = [
|
||||
["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"],
|
||||
["2009", 0, 2941, 4303, 354, 5814],
|
||||
["2010", 5, 2905, 2867, 412, 5284],
|
||||
["2011", 4, 2517, 4822, 552, 6127],
|
||||
["2012", 2, 2422, 5399, 776, 4151]
|
||||
];
|
||||
|
||||
var div = $('div');
|
||||
$('body').append(div);
|
||||
|
||||
div.handsontable({
|
||||
data: data,
|
||||
minSpareRows: 1,
|
||||
colHeaders: true,
|
||||
contextMenu: true
|
||||
});
|
||||
|
||||
var instance: Handsontable.Context = div.handsontable('getInstance');
|
||||
for (var i = 1; i < instance.countCols(); i++) {
|
||||
for (var j = 1; j < instance.countRows(); j++) {
|
||||
var value = parseInt(instance.getDataAtCell(j, i)) * 2;
|
||||
instance.setDataAtCell(j, i, value);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user