Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!