Unable to parse bindings.With knockout 2.2.1 and jQuery 1.9.1 -
my problem code work jquery 1.8.2 not jquery 1.9.1. need jquery 1.9.1 jquery mobile 1.3.0.
this code don't work anymore:
var angebot = function(transporttage) { var self = this; self.angebot = ko.observable(""); self.tage = ko.observable(transporttage); self.formatted = ko.computed(function() { var preis = self.angebot(); var tage = $('#tage').val(); preis = preis.replace(/,/, "."); return round(preis * tage); }); }; ko.applybindings(new angebot('')); function round(x){ var = math.pow(10, 2); return (math.round(x * a) / a); }
and here view:
<div data-role="content" id="angebot"> <div class="application"> <form id="angebotform" method="post"> <div> <input type="hidden" value="updatevalues" name="function"> </div> <fieldset> <legend> <strong>ihr angebot</strong> </legend> <p> <label><span>preis (brutto pro behandlung in €):</span></label> <input type="number" maxlength="10" data-bind="value: angebot" style="display: inline" class="validate[required,custom[number]]" id="preis"> </p> <p> <label>voraussichtliche anzahl der transporttage:</label> <input type="number" disabled="disabled" data-bind="value: transporttage" style="display: inline" class="text disabled" id="tage"> </p> <p> <label>voraussichtliche gesamtkosten (brutto in €):</label> <input type="number" disabled="disabled" data-bind="value: formatted" style="display: inline" class="text disabled" id="gesammtsumme"> </p> </fieldset> </form> </div> <p style="text-align: center"> <a data-role="button" id="angebotweiterleiten" data-icon="arrow-r" data-iconpos="right" data-transition="slide" data-ajax="false">angebot abgeben</a> </p> </div>
the error is: error: unable parse bindings. message: referenceerror: formatted not defined; bindings value: value: formatted
could please help?
Comments
Post a Comment