1

I want to disable 1 row on my grid depending on the value of a global javascript variable. For example, lets say the value of this variable is 123. Then any row which has 123 in a column called "XYZ" should be disabled.

where would be the best way to implement such a functionality ? inside loadcomplete or beforeselectrow ?

Thanks

AbtPst
  • 7,778
  • 17
  • 91
  • 172

1 Answers1

2

The best way for inline editing mode is adding not-editable-row class to the row. You can use rowattr to add the class based on the content of some column. See the answer for details.

If you use form editing you have to choose another way. It you use navGrid then you can disable some editing or hide buttons based on the value in the column of selected row. See the answer and this one for more details. beforeSelectRow is good place for such changes.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • @user2334092: You are welcome! The usage of `rowattr` is really the best way from performance point of view because if you use `gridview: true` (you should use it always) the full grid body will be placed on the page as *one operation*. If you change the grid body inside of `loadComplete` it will work always slowly because the changes of one element on the page follow to [reflow](https://developers.google.com/speed/articles/reflow) of *all existing elements on the page*. See [the answer](http://stackoverflow.com/a/12519858/315935) for more details. – Oleg Jul 24 '13 at 17:28