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

147
Vistas
retrieve the id from the mention.js on select

I am using mention.js basic example

   $('textarea.mention-example2').mentionsInput({
    onDataRequest:function (mode, query, callback) {
        $.getJSON('DataTableJsonFils/systmeQ.json', function(responseData) {
            responseData = _.filter(responseData, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) > -1 });
            callback.call(this, responseData);
        });
    }
});

I have this json array as the data for this example

[
  {
    "id": 1,
    "name": "Kenneth Auchenberg",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 2,
    "name": "Jon Froda",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 3,
    "name": "Anders Pollas",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 4,
    "name": "Kasper Hulthin",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 5,
    "name": "Andreas Haugstrup",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 6,
    "name": "Pete Lacey",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  },
  {
    "id": 7,
    "name": "kenneth@auchenberg.dk",
    "avatar": "http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif",
    "type": "contact"
  }
]

the filter is working fine. my question is how can i get the id value when i select a result from the filter and not the name. I would like to keep filtering over the name value but on select display the id

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