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

239
Vistas
w2ui new event system (w2base) return preventDefault error

Working with the latest w2ui sources from github. On grid events ( editField, change and etc. ) I'm using event preventDefault. It return error :

Uncaught (in promise) undefined
preventDefault  @   w2base.js:52
grido_pries_keitima @   prg_gridai.js:405
(anonymous) @   prg_gridai.js:146
trigger @   w2base.js:213
editField   @   w2grid.js:3129
...


function grido_pries_keitima( obj, event )
{
  let gid = obj.grido_id,
  fld = w2ui[ gid ].columns[ event.detail.column ].field,
  ftp = w2ui[ gid ].columns[ event.detail.column ].editable.type,
  tid = w2ui[ gid ].columns[ event.detail.column ].editable.tid,
  v = ( tid == '' ? -1 : findElement( visi_tipai, "tipo_id", tid ) ),
  etp = ( v == -1 ? '' : visi_tipai[ v ].tipo_tipas ),
  ind = obj.grido_lenta.nauji_patikr
     
  if ( ind && ind == fld )
  {
     pranesk( 'mine message ..." )
     event.preventDefault() // stopPropagation()
  }

With stopPropagation it's working ...

Event :

w2ui[ gid ].on( { type: 'editField', execute: 'before' }, ( target, event )=>{ grido_pries_keitima( obj, event ) } )

Tried and with "true" last parameter :

w2ui[ gid ].on( { type: 'editField', execute: 'before' }, ( target, event )=>{ grido_pries_keitima( obj, event ) }, true )

the same result ...

w2base.js :

    preventDefault() {
    this._reject() // 52 row here
    this.isCancelled = true
}

Strange, that in other grid event -

w2ui[ gid ].on( { type: 'keydown', execute: 'before' }, ( target, event )=>{ grido_keydw( obj, event ) })

and inside function grido_keydw, preventDefault it's working OK ...

What that is bad ? Thanks in advance ...

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