PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Execute a change Jquery event changing the value of a EDT with WedDev
Execute a change Jquery event changing the value of a EDT with WedDev
Débuté par David Cabrera, 06 oct. 2017 16:36 - 2 réponses
Posté le 06 octobre 2017 - 16:36
I have this code in row selection of a table:
--------------------------------------------------------------------------------------------------
sBiblioteca is string
IF TABLE_Biblioteca.COL_BIB_TIPO = 1 THEN
sBiblioteca += [
<div style="border: 1px solid lightgray;" tipo="1" id="
]+QRY_SEL_BIBLIOTECA.BIB_CLAVE+
[
" ondrop="drop(event)" ondragover="allowDrop(event)" ><img src="\
]+FolderWeb()+"\iblioteca\"+TABLE_Biblioteca.COL_BIB_RUTAARCHIVO+
[
" draggable="true" ondragstart="drag(event)" tipo="1" id="
]+TABLE_Biblioteca.COL_NUM_CTRL+
[
" class="img-responsive" style="height: 100%; margin: 0 auto;"></div>
]
ELSE
sBiblioteca += [
<div style="border: 1px solid lightgray; height: 100%;" class="modal-video" tipo="2" id="
]+TABLE_Biblioteca.COL_NUM_CTRL+
[
" draggable="true" ondragstart="drag(event)">
<video style="width: 100%; height: 100%;" controls>
<source src="\
]+FolderWeb()+"\iblioteca\"+TABLE_Biblioteca.COL_BIB_RUTAARCHIVO+
[
" type="video/mp4">
</video>
</div>
]
END

EDT_ArchivoBiblioteca = sBiblioteca

--------------------------------------------------------------------------------------------------

And I need to hear the change event to execute a jquery statement, I have this Jquery code in the advanced tab in the page description.

--------------------------------------------------------------------------------------------------

<script>
$(document).ready(function() {

$("#A44").on("change copy keyup", function() {
$("#biblioteca").html($("#A44").val());
});

});
</script>

--------------------------------------------------------------------------------------------------

It works fine if I manually change the value of the EDT, but I need that EDT fence hidden and that the change of Jquery recognizes when WebDev assigns the value by programming.

Any ideas on how to do this? Or what other jquery event can I use to recognize the value change made by webdev?

Thanks in advance
Posté le 06 octobre 2017 - 16:55
David,

Can you explain simply what the process is that you are trying to achieve.

Surely, using the "mouse over" , you can pick up the value of the edt control and then call a procedure to do what you want. This should be OK within Webdev so you would have the values that you need.

Then you would not need jquery.

Kindest Regards,

Mike
Posté le 09 octobre 2017 - 20:33
Good afternoon Mike.

What I wanted to do was to modify the HTML code that I was generating and assigned to an HTM control, but only modifying part of it and not changing certain information that had been modified in execution.

Inside the HTM control I visualized images, and wanted to change the image after a select row. I wanted to change only the image and not all the contents of HTM control, so I wanted to use Jquery.

But I could not find the way to run Jquery code after the select row since there was no browser code, and so I wanted to use an event listener to detect when an EDT control would change its value in the row selection, and if I thought about it mouse over, but it made me impractical.

In the end the solution was very simple, accommodate what HTM control was assigned in two HTM controls, so it was no longer necessary to use jQuery, it was only necessary to change the HTM Control where it visualized the image.

Many times the simplest is the solution, I wanted to use jquery to continue using a single HTM control, in the end I split it into two HTM controls and that was the solution.

Thank you for your contribution