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

157
Views
obtener el origen del evento que desencadena eventos en otros elementos

En una vista ASPX MVC, uso TypeScript para controlar la interacción del cliente. El evento de cambio de algunos elementos podría desencadenar una secuencia de eventos de cambio de otros elementos. En cada uno de los cambios () de los otros elementos, necesito verificar si se activa por el elemento en sí, o por el elemento anterior, o por el primer elemento que activa la cadena de eventos. En este ejemplo, es Q12 o Q23, o ambos. Gracias.

 const Q12: any = $('.persistable[id^=Q12_]'); const Q23: any = $('.persistable[id^=Q23_]'); const otherPersistables: any = $('.persistable:not([id^=Q12_]):not([id^=Q23_])'); if (commonUtility.isEmpty(Q12) || commonUtility.isEmpty(Q23)) { otherPersistables.each( function() { //disable this element and trigger it change() event $(this).prop('disabled', ture).change(); } ); } else { otherPersistables.each( function() { //enable this element and trigger its change() event $(this).prop('disabled', false).change(); } ); } //add event listener to each of the other persistable elements otherPersistables.each( const thisOtherElment = $(this); thisOtherElment.on("change", function() { //how to check what really initiates this change if not by this element //for example, it could be Q23 or Q12, or both } } );

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!