0

I am trying to do conditionally editable cells in kendo by writing code:

   edit: function (e) {                         
      var kendoTextBox = e.container.find("input[name=Ordertype]")[0];
      if (kendoTextBox)
        kendoTextBox.enable(e.model.RequestAmount == 0);
    },

The ordertype column should be editable when RequestAmount column is 0, but is not. Can someone tell me where am I wrong?

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
Aviator
  • 613
  • 4
  • 11
  • 26
  • What is the result of the code you have written? – Peter DeWeese Mar 06 '15 at 13:38
  • Removed "thanks", explained that the expected result is not happening, and improved grammar. Needs a better explanation of what the result of the code is. – Peter DeWeese Mar 06 '15 at 13:40
  • Sorry, the result of the written code is nothing, as before, without code :/ the console says nothing also – Aviator Mar 06 '15 at 13:45
  • possible duplicate of [Make cell readonly in Kendo Grid if condition is met](http://stackoverflow.com/questions/20881484/make-cell-readonly-in-kendo-grid-if-condition-is-met) – Lars Höppner Mar 10 '15 at 09:19

1 Answers1

-1

Try this

edit: function (e) {
    var kendoTextBox = e.container.find("input[name=Ordertype]")[0];
    if (kendoTextBox && e.model.RequestAmount !== 0) 
        this.closeCell();
}
Harsh
  • 1,072
  • 1
  • 10
  • 16