Last active
October 12, 2015 06:58
-
-
Save optikalefx/3988618 to your computer and use it in GitHub Desktop.
Custom Cell Types and Custom Callbacks
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
<table class="grid demo5" action="ajax.php"> | |
<tr> | |
<th col="Price" type="money">Price</th> | |
<th col="TutorialID" type="hashBang">TutorialID</th> | |
</tr> | |
</table> |
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
<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