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

148
Vistas
How to disable the DataTables dropdown option?

I have the following DataTables Editor constructed.

var editor;
 
$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "../php/data.php",
        table: "#example",
        fields: [ {
                label: "User:",
                name:  "user"
            }, {
                label: "User Data:",
                name:  "selections",
                type:  "select",
                options: [
                    { label: "abc", value: "abc" },
                    { label: "xyz", value: "xyz" },
                    { label: "pqr", value: "pqr" },
                    { label: "def", value: "def" },
                    { label: "lmn", value: "lmn" }
                ]
            }
        ]
    });
});

Now I want to disable the select options with values 'pqr' and 'lmn'. It should mean that users are able to see this options but they cannot select it. I tried using $("select option[selections='pqr']").prop('disabled',true); But it didn't work for me.

Is there an inbuilt DataTables property through which I can do this? Or any other way?

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