From 842958eecbfd5b48e1705d5ec259e453a47dad08 Mon Sep 17 00:00:00 2001 From: Adrian Ehrsam Date: Wed, 15 Jul 2015 16:40:00 +0200 Subject: [PATCH] Access to uid --- spec/knockout-kendoSparkline.spec.js | 11 ----------- src/knockout-kendo-core.js | 8 ++++++-- 2 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 spec/knockout-kendoSparkline.spec.js diff --git a/spec/knockout-kendoSparkline.spec.js b/spec/knockout-kendoSparkline.spec.js deleted file mode 100644 index e33e209..0000000 --- a/spec/knockout-kendoSparkline.spec.js +++ /dev/null @@ -1,11 +0,0 @@ -describe("ko.bindingHandlers.kendoSparkline", function(){ - //standard cases - ko.kendo.generateBindingSpecs("kendoSparkline", { - html: "
", - defaultValue: "test", - newValue: "new" - }); - - //additional kendoSparkLine cases - -}); \ No newline at end of file diff --git a/src/knockout-kendo-core.js b/src/knockout-kendo-core.js index 554d8fa..529971e 100644 --- a/src/knockout-kendo-core.js +++ b/src/knockout-kendo-core.js @@ -88,8 +88,12 @@ ko.kendo.BindingFactory = function() { }; var templateRenderer = function(id, context) { - return function(data) { - return ko.renderTemplate(id, context.createChildContext((data._raw && data._raw()) || data)); + return function (data) { + var rawdata = data._raw && data._raw(); + if (rawdata && data.uid) { + rawdata.uid = rawdata.uid || data.uid; + } + return ko.renderTemplate(id, context.createChildContext(rawdata || data)); }; };