Knockout bindings for x-editable
npm install knockout-x-editableknockout-x-editable
===================
knockout binding handler for x-editable - See http://vitalets.github.com/x-editable
javascript
var viewModel = function(){
var self = this;
self.id = ko.observable();
self.firstName = ko.observable();
self.lastName = ko.observable();
self.gender = ko.observable();
self.genders = ko.observableArray();
}
`
and binding:
`html
`
will set editable options value (value of firstName) and name to firstName. Your observable is updated to the new value in the save event (you can also pass your own save event that gets called after).
Advanced
You can pass through any editable options with:
`html
`
Note the pk can be an observable since x-editable just calls it as a function.
The option editableOptions.visible can be passed an observable, this sets the x-editable toggle to 'manual', then uses the observable to fire the 'show' method
You can also pass in the bindTextInput option for two-way updates (see http://knockoutjs.com/documentation/textinput-binding.html):
`html
`
$3
For select and checklist, you can pass options just as you would to knockout:
`html
``