Skip to content

Instantly share code, notes, and snippets.

@optikalefx
Last active October 12, 2015 06:58
Show Gist options
  • Save optikalefx/3988618 to your computer and use it in GitHub Desktop.
Save optikalefx/3988618 to your computer and use it in GitHub Desktop.
Custom Cell Types and Custom Callbacks
<table class="grid demo5" action="ajax.php">
<tr>
<th col="Price" type="money">Price</th>
<th col="TutorialID" type="hashBang">TutorialID</th>
</tr>
</table>
<script>
$(function(){
var $grid = $(".demo5").grid({
editing: true,
cellTypes : {
"hashBang": function(value, columnOpts, grid) {
return {
cellClass: "",
cellValue: "/#!/"+value
}
}
}
})
// add load complete callback
$grid.on("loadComplete",function(e) {
console.log("loadComplete", this.instance);
// add cell click callback
}).on("cellClick",function(e, $cell, rowData) {
$(this).grid("notify",$cell.text(),800);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment