Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

289
Vistas
In Angular ag-grid, how to disable some values from selection in a dropdown

I am able to pass values to a dropdown as an array, however I would like for some of the values to be non selectable to the user(disabled state). The reason being, I want to be able to toggle the disabled state of these values based on the users permissions.

By column definition is as below :-

this.columnDefs.push({
          headerName: this.FIELD_NAME.toUpperCase(),
          field: this.FIELD_NAME,
          cellStyle: getBackgroundColor,
          editable: true,
          cellClass: cellClass,
          headerTooltip: this.DESCRIPTION,
          cellEditor: 'agSelectCellEditor',
          cellEditorParams: {
            values: this.approvalStatus
          }
        })

and the array is as follows :-

approvalStatus: any[] = [{name: 'Not Started',disable: false},{name: 'Work In Progress',disable: false},
     {name: 'On Hold',disable: false},{name: 'Pending',disable: true},
   {name: 'Completed',disable: true}];

I would like the user to be able to see all 5 options in the dropdown but not be able to select 'Pending' & 'Completed'.

Am I doing anything wrong or do I need to use a different cellEditor in this case?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda