Created
January 20, 2014 16:14
-
-
Save zine56/8523090 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/> | |
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.8.16.custom.css" type="text/css"/> | |
<link rel="stylesheet" href="examples.css" type="text/css"/> | |
</head> | |
<body> | |
<table width="100%"> | |
<tr> | |
<td valign="top" width="50%"> | |
<div id="myGrid" style="width:600px;height:500px;"></div> | |
</td> | |
<td valign="top"> | |
<h2>Demonstrates:</h2> | |
<ul> | |
<li>column span</li> | |
</ul> | |
<h2>View Source:</h2> | |
<ul> | |
<li><A href="https://github.com/mleibman/SlickGrid/blob/gh-pages/examples/example-colspan.html" target="_sourcewindow"> View the source for this example on Github</a></li> | |
</ul> | |
</td> | |
</tr> | |
</table> | |
<script src="../lib/jquery-1.7.min.js"></script> | |
<script src="../lib/jquery.event.drag-2.2.js"></script> | |
<script src="../slick.core.js"></script> | |
<script src="../plugins/slick.cellrangedecorator.js"></script> | |
<script src="../plugins/slick.cellrangeselector.js"></script> | |
<script src="../plugins/slick.cellselectionmodel.js"></script> | |
<script src="../slick.grid.js"></script> | |
<!-- no pertenecientes al ejemplo --> | |
<script language="JavaScript" src="../lib/jquery-ui-1.8.24.custom.min.js"></script> | |
<script src="../lib/jquery.event.drag-2.2.js"></script> | |
<script src="../lib/jquery.mousewheel.js"></script> | |
<script src="../slick.editors.js"></script> | |
<script src="../slick.formatters.js"></script> | |
<script src="../slick.dataview.js"></script> | |
<script src="../controls/slick.pager.js"></script> | |
<script src="../controls/slick.columnpicker.js"></script> | |
<script> | |
$(function() { | |
$('#frozenColumn').val(options.frozenColumn); | |
}); | |
var grid; | |
var columns = [ | |
{id: "title", name: "Title", field: "title"}, | |
{id: "duration", name: "Duration", field: "duration"}, | |
{id: "%", name: "% Complete", field: "percentComplete", selectable: false}, | |
{id: "start", name: "Start", field: "start"}, | |
{id: "finish", name: "Finish", field: "finish"}, | |
{id: "effort-driven", name: "Effort Driven", field: "effortDriven"} | |
]; | |
var options = { | |
editable: true, | |
enableAddRow: true, | |
enableCellNavigation: true, | |
asyncEditorLoading: true, | |
forceFitColumns: false, | |
autoEdit: true, | |
topPanelHeight: 25, | |
frozenColumn: 1, | |
frozenRow: 1, | |
showHeaderRow: false, | |
syncColumnCellResize: true | |
}; | |
$(function () { | |
var data = []; | |
for (var i = 0; i < 10000; i++) { | |
data[i] = { | |
title: "Task " + i, | |
duration: "5 days", | |
percentComplete: Math.round(Math.random() * 100), | |
finish: "01/05/2009", | |
start: "01/01/2009", | |
effortDriven: (i % 5 == 0) | |
}; | |
} | |
data.getItemMetadata = function (row) { | |
if (row == 0) { | |
return { | |
"columns": { | |
"duration": { | |
"colspan": 2 | |
} | |
} | |
}; | |
} else { | |
return null; | |
} | |
}; | |
grid = new Slick.Grid("#myGrid", data, columns, options); | |
grid.setSelectionModel(new Slick.CellSelectionModel()); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment