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

294
Views
Obtención de error: no puede aplicar enlaces varias veces al mismo elemento en OJET

A continuación se muestra mi código HTML para abrir oj-dialog

 <div id="dialogWrapper"> <div style="display:none" id="modalDialog1" title="Modal Dialog" data-bind="ojComponent:{component: 'ojDialog', initialVisibility: 'hide', open: dialogOpen, close: dialogClose, rootAttributes: { class: 'animate' }}"> <div class="oj-dialog-body"> The dialog window can be moved, resized and closed with the 'x' icon. Arbitrary content can be added to the the oj-dialog-body and oj-dialog-footer sections. </div> <div class="oj-dialog-footer"> <button id="okButton" data-bind="click: closeDialog, ojComponent: {component: 'ojButton', label: 'OK'}"> </button> </div> </div> <button id="buttonOpener" data-bind="click: openDialog, ojComponent: {component: 'ojButton', label: 'Open Modal Dialog'}"></button> </div>

A continuación se muestra mi código js correspondiente:

 define(['require', 'exports', 'knockout', 'ojs/ojbootstrap', 'ojs/ojknockout', 'ojs/ojbutton', 'ojs/ojdialog'], function(ko, oj, $) { 'use strict'; var ViewModel = function() { var self = this; self.openDialog = function() { $("#modalDialog1").ojDialog("open"); }; self.closeDialog = function(data, event) { // attempt fadeOut with jQuery $(event.target) .closest(".oj-dialog.animate") .fadeOut(function() { console.log("faded out", this); $("#modalDialog1").ojDialog("close"); }); }; self.dialogOpen = function(event, ui) { $(event.target) .closest(".oj-dialog.animate") .addClass("fully-opaque"); }; self.dialogClose = function(event, ui) { $(event.target) .closest(".oj-dialog.animate") .removeClass("fully-opaque"); }; }; ko.applyBindings(new ViewModel()); });

Cuando ejecuto este código, aparece "Error: no puede aplicar enlaces varias veces al mismo elemento". error. Soy nuevo en el desarrollo y, según el documento, he agregado todas las bibliotecas. ¿Alguien puede ver dónde está yendo mal?

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!