NewBuddy
NewBuddy

Reputation: 55

angular ui grid disable or enable cell selection /focus conditionally

I have a requirement that, once i fetch data and bind it to UI grid, based on the cell data, i should enable/ disable cell selection. For cell navigation? I am already set the cellNav option to my UI grid. When i check the options, i see the below reference:

//Enables cell selection. enableCellSelection: false, // no more in v3.0.+

but it is saying no more for v3.0+, but as of now, i am using 3.0+ version only. I am looking for a code reference with a function instead of "false" option, and my function will check the cell data and put the option..?? any references?

Upvotes: 1

Views: 3598

Answers (1)

Brian
Brian

Reputation: 5059

I think you are looking for allowCellFocus:

{
  name: 'FieldName',
  allowCellFocus: false
}

I am not sure what you mean by based on the cell data. If you want to enable/disable only some cells in a given column, it would have to be something that is super custom, and would probably land in the realm of very hacky.

Upvotes: 1

Related Questions