Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #12. Changed reference to ko.bindingContext to bindingContext.c…

…reateChildContext as recommended in issue knockout/knockout#501 (comment)
  • Loading branch information...
commit fc5dcd8ce6918ee2b3b7a823482405bc9abf0b9a 1 parent e134a0a
@ducka ducka authored
View
4 Demo/Knockout.Extensions.Demo.Web/Scripts/knockout.bindings.dataTables.js
@@ -56,7 +56,7 @@ ko.bindingHandlers['dataTable'] = {
if (binding.rowTemplate && binding.rowTemplate != '') {
options.fnRowCallback = function (row, data, displayIndex, displayIndexFull) {
// Render the row template for this row.
- ko.renderTemplate(binding.rowTemplate, new ko.bindingContext(data, bindingContext), null, row, "replaceChildren");
+ ko.renderTemplate(binding.rowTemplate, bindingContext.createChildContext(data), null, row, "replaceChildren");
return row;
}
}
@@ -149,7 +149,7 @@ ko.bindingHandlers['dataTable'] = {
destRow.append(newCell);
// bind the cell to the observable in the current data row.
var accesor = eval("srcData['" + columnName.replace(".", "']['") + "']");
- ko.applyBindingsToNode(newCell[0], { text: accesor }, new ko.bindingContext(srcData, bindingContext));
+ ko.applyBindingsToNode(newCell[0], { text: accesor }, bindingContext.createChildContext(srcData));
});
return destRow[0];
View
4 Javascript/src/knockout.bindings.dataTables.js
@@ -56,7 +56,7 @@ ko.bindingHandlers['dataTable'] = {
if (binding.rowTemplate && binding.rowTemplate != '') {
options.fnRowCallback = function (row, data, displayIndex, displayIndexFull) {
// Render the row template for this row.
- ko.renderTemplate(binding.rowTemplate, new ko.bindingContext(data, bindingContext), null, row, "replaceChildren");
+ ko.renderTemplate(binding.rowTemplate, bindingContext.createChildContext(data), null, row, "replaceChildren");
return row;
}
}
@@ -149,7 +149,7 @@ ko.bindingHandlers['dataTable'] = {
destRow.append(newCell);
// bind the cell to the observable in the current data row.
var accesor = eval("srcData['" + columnName.replace(".", "']['") + "']");
- ko.applyBindingsToNode(newCell[0], { text: accesor }, new ko.bindingContext(srcData, bindingContext));
+ ko.applyBindingsToNode(newCell[0], { text: accesor }, bindingContext.createChildContext(srcData));
});
return destRow[0];
Please sign in to comment.
Something went wrong with that request. Please try again.