Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 6e30827621
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (66 sloc) 2.054 kB
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SlickGrid example: Custom column value extractor</title>
<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"/>
<table width="100%">
<td valign="top" width="50%">
<div id="myGrid" style="width:600px;height:500px;"></div>
<td valign="top">
<li>using <u>dataItemColumnValueExtractor</u> option to specify a custom column value extractor</li>
<script src="../lib/jquery-1.7.min.js"></script>
<script src="../lib/jquery.event.drag-2.0.min.js"></script>
<script src="../slick.core.js"></script>
<script src="../slick.grid.js"></script>
var grid;
var columns = [
{id: "title", name: "Name", field: "name"},
{id: "field1", name: "Field1", field: "values", fieldIdx: 0},
{id: "field2", name: "Field2", field: "values", fieldIdx: 1},
{id: "field3", name: "Field3", field: "values", fieldIdx: 2}
var options = {
enableCellNavigation: true,
enableColumnReorder: false,
dataItemColumnValueExtractor: getItemColumnValue
// Get the item column value using a custom 'fieldIdx' column param
function getItemColumnValue(item, column) {
var values = item[column.field];
if (column.fieldIdx !== undefined) {
return values && values[column.fieldIdx];
} else {
return values;
$(function () {
var data = [];
for (var i = 0; i < 500; i++) {
data[i] = {
name: "Item " + i,
values: [
Math.round(Math.random() * 100),
Math.round(Math.random() * 100),
Math.round(Math.random() * 100)
grid = new Slick.Grid("#myGrid", data, columns, options);
Jump to Line
Something went wrong with that request. Please try again.