Last active
December 26, 2015 05:59
-
-
Save funkytaco/7105052 to your computer and use it in GitHub Desktop.
openJS cellTypes not working
This file contains hidden or 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 lang="en"> | |
<head> | |
<link rel="stylesheet" href="/bootstrap/css/bootstrap.css"/> | |
<link rel="stylesheet" href="/grid.css" title="openJsGrid"/> | |
<script src="/jquery.js" type="text/javascript"></script> | |
<script src="/root.js" type="text/javascript"></script> | |
<script src="/grid.js" type="text/javascript"></script> | |
<style> | |
.cell.warning { | |
background-color:red; | |
color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>Alarms</h2> | |
<table class="grid alarms" action="ajax.php"> | |
<tr> | |
<th col="alarmtype">Alarm Type</th> | |
<th col="alert">Alert</th> | |
</tr> | |
</table> | |
<script> | |
$(function(){ | |
var $grid = $(".alarms").grid({ | |
editing: true, | |
cellTypes : { | |
"alert": function(value, columnOpts, grid) { | |
console.log(value); //undefined | |
console.log(columnOpts); //undefined | |
console.log(grid); //undefined | |
return { | |
cellClass: value, | |
cellValue: value | |
} | |
} | |
} | |
}) | |
}).on("rowClick",function(e, $rows,rowData) { | |
console.log("rowClick",$rows,rowData); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment