mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 12:16:38 +08:00
23 lines
542 B
TypeScript
23 lines
542 B
TypeScript
/// <reference path="gridster.d.ts" />
|
|
|
|
interface SerializeData {
|
|
x?: number;
|
|
y?: number;
|
|
}
|
|
|
|
var options: GridsterOptions = {
|
|
min_cols: 5,
|
|
autogenerate_sytesheet: true,
|
|
serialize_params: ($w: JQuery, wgd: GridsterCoords) => {
|
|
return {
|
|
x: wgd.row,
|
|
y: wgd.col
|
|
};
|
|
}
|
|
};
|
|
|
|
var gridster: Gridster = $('.gridster ul').gridster(options).data('gridster');
|
|
gridster.add_widget('<li class="new">The HTML of the widget...</li>', 2, 1);
|
|
gridster.remove_widget($('gridster li').eq(3).get(0));
|
|
var json = gridster.serialize<SerializeData>();
|