Imre Fazekas
Imre Fazekas
That would be nice to have indeed!
Wrote a simple test: ``` function AppViewModel() { this.firstName = ko.observable("Bert"); this.lastName = ko.observable("Bertington"); this.fullName = ko.computed(function() { return this.firstName() + " " + this.lastName(); }, this); this.capitalizeLastName = function()...
OK, thank you.
After executing this: ``` ko.applyBindings(theViewModel); ``` I receive this Error for toJSON: ``` Pass a function that returns the value of the ko.computed ```
By executing this: ``` theViewModel.toJSON = function() { var copy = ko.toJS(this); delete copy['$__page__']; return copy; }; ``` The JSON export seems fine till the applyBindings. After it I receive...
Here is a complete very small sample what I'm dealing with, hope it helps: ``` Sportif: $(document).ready(function(){ pager.Page.prototype.toJSON = function() { return this.ctx; }; function AppViewModel() { this.firstName = ko.observable("Bert");...
The problem is, that after the pager starts, some elements will posses attributes like this: selectionDirection: [Exception: Error] selectionEnd: [Exception: Error] selectionStart: [Exception: Error] And here the knockoutJS will fail...
Commenting out all pager-related code from temp.html and the input element does not have such attributes and knockout runs perfectly.
Just made a workaround solution: https://github.com/finnsson/pagerjs/pull/130 Maybe not the best solution but works perfectly for me.
Yep, saw it. Meanwhile I push requested the code at knockout code repository too. A 'validated' toJS would be needed anyhow for me.