Created
June 7, 2013 00:24
-
-
Save adamalex/5726207 to your computer and use it in GitHub Desktop.
Using Knockout to attach a Fuel UX datagrid to an element
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
// 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