Skip to content

Instantly share code, notes, and snippets.

@adamalex
Created June 7, 2013 00:24
Show Gist options
  • Save adamalex/5726207 to your computer and use it in GitHub Desktop.
Save adamalex/5726207 to your computer and use it in GitHub Desktop.
Using Knockout to attach a Fuel UX datagrid to an element
// KO binding for attaching a Fuel UX datagrid to an element
ko.bindingHandlers.dataGrid = {
init: function (element, valueAccessor) {
$(element).datagrid({ dataSource: valueAccessor() });
}
};
// Usage:
//
// getGridDataSource should return an instance of a datasource
// https://github.com/ExactTarget/fuelux/wiki/Using-the-datagrid
//
// <table class="table table-bordered datagrid" data-bind="dataGrid: $parent.getGridDataSource($data)">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment