7

How do I make some rows editable and some rows non-editable in slickgrid?

ranendra
  • 2,492
  • 2
  • 19
  • 29

2 Answers2

11

Set the onBeforeEditCell event handler and return false to prevent the cell from going into edit mode.

Laurence
  • 58,936
  • 21
  • 171
  • 212
Tin
  • 9,082
  • 2
  • 34
  • 32
  • 2
    Thanks Tin, adding the following code to the grid did the trick. grid.onBeforeEditCell = function(row, col, row) { if(row['key'] == "value") return false; }; – ranendra Feb 02 '11 at 08:15
1

Or you can simply designate some columns not to be editable without specifying any editor attribute.

Ex

columns = [
    {id:"id",name:"#",field:"id"},
    {id:"editable",name:"clicky",field:"editable",editor:Slick.Editors.Text}
];

Depends if you want to loop an auxiliary array and apply if criteria.

Hope it helps

cristi _b
  • 1,783
  • 2
  • 28
  • 43