(function() { BemsWebApplication.BemsFormulaTableValueViewModel = function(data) { this.TableId = ko.observable(); this.XValue = ko.observable(); this.YValue = ko.observable(); if(data) this.fromJS(data); }; $.extend(BemsWebApplication.BemsFormulaTableValueViewModel.prototype, { toJS: function() { return { TableId: this.TableId(), XValue: this.XValue(), YValue: this.YValue(), }; }, fromJS: function(data) { if(data) { this.TableId(data.TableId); this.XValue(data.XValue); this.YValue(data.YValue); } } }); })();