I want to add a callback when the user selects a row in the table, but I can't figure out how to do so...
Here's what I have so far:
<script src="/js/jquery-1.4.2.min.js"></script>
<script src="jquery-ui-1.8.8.custom.min.js"></script>
<script src="jquery.event.drag.2.0.min.js"></script>
<script src="slick.core.js"></script>
<script src="slick.rowselectionmodel.js"></script>
<script src="slick.grid.js"></script>
<script>
var grid;
var columns = [ /* my column definitons */ ];
var options = {
enableCellNavigation: true,
enableColumnReorder: false,
enableAddRow: true
};
$(function() {
$.getJSON('/actions/unit_list.php', function (data) {
grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.RowSelectionModel());
$('#myGrid').show();
});
});
</script>
With this, I can select the row (as per this example), but I've no idea how to add a callback when the rows are selected (preferably something that returns the row id(s), since I want to use those to load something else on the page).
Can anyone help me with this?