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

248
Vistas
ExtJS - Make store generate IDs with numbers only

When a new entry is added to a store in ExtJS 6.2 it automatically creates a new ID with the name of the model and a numeric ID (MODEL-ID) if you didn't specify any field as ID.

Is it possible to make the store generate IDs only containing the number?

Fiddle: https://fiddle.sencha.com/#fiddle/3gk0&view/editor
Instead of User-1, User-2, User-3, only have 1, 2, 3.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to add a custom identifier setting to the model, see below. This will set the id property which is added by default to the Model even if you don't list it among fields:

Ext.define('User', {
    extend: 'Ext.data.Model',
    identifier: {
        type: 'sequential',
        seed: 1,
        increment: 1
    },
    fields: [{
        name: 'age',
        type: 'int'
    }, {
        name: 'name',
        type: 'string'
    }, {
        name: 'email',
        type: 'string'
    }, {
        name: 'phone',
        type: 'string'
    }],
});

But keep in mind that these are phantom identifiers, meaning only exist on the client. In most cases servers generate real id fields, and clients get these from servers.

about 4 years ago · Juan Pablo Isaza Denunciar
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