Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

237
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda