This is a migrated thread and some comments may be shown as answers.

Custom Binding and Grid Editor Template

0 Answers 166 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 14 Aug 2012, 10:07 AM
Hi

I have a grid where I have a column with a custom editor template
{ field: "ShiftDefinitionId", title: "ShiftDefinitionId", format: "{0:n0}", width: "150px", editor: ShiftDefinitionIdEditor }

And also a corresponding editor template javascript function like
  function ShiftDefinitionIdEditor(container, options) {
    var inputField = $('<input data-text-field="ShiftDefinitionId" data-value-field="ShiftDefinitionId" data-bind="shiftDefinitionIdLookup: ShiftDefinitionId"/>')
    inputField.appendTo(container)
};

So now my problem is inside the custom binding
kendo.data.binders.shiftDefinitionIdLookup = kendo.data.Binder.extend({
  init: function () {
    var element = this.element;
  },
  refresh: function () {
    var element = this.element;
  }
});

this.element is undefined, but if i bind somewhere else the custombinding to a control, this.element is set.

How can I fix this problem

Regards
Roland

No answers yet. Maybe you can help?

Tags
MVVM
Asked by
Roland
Top achievements
Rank 1
Share this question
or