Problem 1:
I think it's the way I have it setup, it shouldn't be initialized EVERY time...but I'm just not sure how to re-call the DS with the proper values. The problem is the error event KEEPs getting triggered even though it appears as if it works.
Video:http://screencast.com/t/xopirauz0W
Ok, so if I have the error event in there, it just hits it immediatly, if I remove the error event it WORKS the first time, then fails the second time.
Live URL: http://dev.gourmetsleuth.com/calc.aspx
Problem 2:
So I tried seperating it out to the "data" property to see if that changed anything. However the data property is encoding variables on me
So given this:
the $format and $callback get changed to %24format which obviously fails....so no big deal, if I add them to the transport->read->url then it's smart enough to append the other data items without the duplicate question mark (great!)
However the oData\WCF service fails if I don't wrap my string variables in single quotes....but when I DO that in the above case it again encodes it, and fails :/
I think it's the way I have it setup, it shouldn't be initialized EVERY time...but I'm just not sure how to re-call the DS with the proper values. The problem is the error event KEEPs getting triggered even though it appears as if it works.
Video:http://screencast.com/t/xopirauz0W
Ok, so if I have the error event in there, it just hits it immediatly, if I remove the error event it WORKS the first time, then fails the second time.
function calculateResult() { var result = 0.0; var quantity = _quantityBox.value(); var fromList = $("#from-select").data("kendoDropDownList"); var toList = $("#to-select").data("kendoDropDownList"); var toDataItem = getWeightDataItem(toList.value()); //Calculate Result $("#result").html("Calculating Result...one moment please"); var conversionDS = new kendo.data.DataSource({ transport: { read: { url: _oDataBasePath + "/USDA.svc/ConvertData?$format=json&$callback=callback&ndbno=" + toDataItem.NDB_No + "&seq=" + toDataItem.Seq + "&qty='" + quantity + "'&from='" + fromList.text() + "'&fromID=" + fromList.value() + "&to='" + toList.text() + "'&toID=" + toList.value(), dataType: 'jsonp', cache: false, jsonp: false, jsonpCallback: 'callback' } }, change: function () { alert("works!"); var convertedData = this.data().d[0]; $("#result").html(convertedData); } }).read();Live URL: http://dev.gourmetsleuth.com/calc.aspx
Problem 2:
So I tried seperating it out to the "data" property to see if that changed anything. However the data property is encoding variables on me
So given this:
data: { $format : "json", $callback: "callback", ndbno: toDataItem.NDB_No, seq: toDataItem.Seq, qty: quantity, from: "'" + fromList.text() + "'", fromID: fromList.value(), to: "'" + toList.text() + "'", toID: toList.value() },the $format and $callback get changed to %24format which obviously fails....so no big deal, if I add them to the transport->read->url then it's smart enough to append the other data items without the duplicate question mark (great!)
However the oData\WCF service fails if I don't wrap my string variables in single quotes....but when I DO that in the above case it again encodes it, and fails :/