EPrints Technical Mailing List Archive
Message: #01951
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Problem with EPrints and adding javascript to a new created field.
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Problem with EPrints and adding javascript to a new created field.
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- Date: Tue, 21 May 2013 16:50:47 +0100
Does your custom javascript adds some event handlers to the component (to detect that the value has changed)?
That's a tricky one... you can only re-apply the handlers after the ajax callback returns. And as far as I know there are no ways to detect the DOM has changed and/or the new elements have been inserted into the DOM...Yes, actually what I do is to detect when the select elements (dropdown menu) I've added change their default value and if so, then execute my ajax call..If so, I suspect those handlers will get removed/erased when pressing [More input rows] because the component is then reloaded (via an AJAX callback). Seb.And could I do in order to make it work?
You could perhaps add another "click" handler on the [More input rows] button that triggers a piece of code that periodically looks for the <select> element you need. Once the <select> is in the DOM, you can re-apply your handler. Might work, might not, I'm not sure.
Also, if you don't need jQuery for anything else, I'd suggest you write your code using the Prototype library which comes with EPrints.
Good luck, Seb.
- References:
- [EP-tech] Problem with EPrints and adding javascript to a new created field.
- From: "Joel Rosental R." <joel.rosental@imdea.org>
- [EP-tech] Re: Problem with EPrints and adding javascript to a new created field.
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: Problem with EPrints and adding javascript to a new created field.
- From: "Joel Rosental R." <joel.rosental@imdea.org>
- [EP-tech] Problem with EPrints and adding javascript to a new created field.
- Prev by Date: [EP-tech] Re: Display of items under review
- Next by Date: [EP-tech] YNT: Re: Access problem to the links on EPrints
- Previous by thread: [EP-tech] Re: Problem with EPrints and adding javascript to a new created field.
- Next by thread: [EP-tech] YNT: Re: Access problem to the links on EPrints
- Index(es):