Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

vue.js - how to make row disabled with ag-grid?

I work with ag-grid and i found how to make a column disabled in the doc (https://www.ag-grid.com/documentation-main/documentation.php) but after reading doc i never find how can i make juste one row disabled.

i have already try editable: params => params.data.active === true. Maybe i didn't read right or that doesn't exist. Is someone here with some soluce track ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

TL;DR

There is no option in the library to make a single row disabled(both visually and keyboard event based), the only way we could make a single row disabled is by using a customCellRenderer for both header and subsequent cell checkboxes, this allows full control over the checkbox. Besides this, there are three other ways where you can disable ag-grid checkbox based on value,

1)This is using checkBoxSelection param, it would empty the cell based on the condition.

checkboxSelection = function(params) {

   if (params.data.yourProperty) {
      return true;
   }
   return false;
}
  1. This would only disabled click events and style it accordingly,

cellStyle: params => return params.data.status? {'pointer-events': 'none', opacity: '0.4' } : '';

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...