Skip to content

Instantly share code, notes, and snippets.

@adamalex
Created June 7, 2013 00:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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