setOnchange for a grid inside a subform

Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules
Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
fibo2358
Posts: 26
Joined: Wed Nov 16, 2016 6:35 am
Country: Poland

setOnchange for a grid inside a subform

Unread postby fibo2358 » Thu Nov 09, 2017 8:39 am

Hello,

I have a grid inside a subform. I would like to set the onchange event handler that is called each time when a value in the grid field is changed, i.e. when a dropdown value is selected inside a grid.

In a subform I use

$("#2329784615a02bce335c442069321071").setOnchange (verifyOnchange);

function verifyOnchange() {
...
}

and it works fine in a subform, but it doesn't work when I display the master form.
Moving the code to the master form javascript doesn't solve the problem.

Could you please help?

Best Regards,
fibo2358

amosbatto
Posts: 5566
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: setOnchange for a grid inside a subform

Unread postby amosbatto » Fri Nov 10, 2017 1:39 am

First of all, please file a bug report about this problem at http://bugs.processmaker.com

As a workaround, you can use standard jQuery, like this:

Code: Select all

$("#2329784615a02bce335c442069321071").change( function(e) {
   verifyOnchange(e);
})

function verifyOnchange(e) {
   alert(e.target.id + ': ' + e.target.value);
}
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

fibo2358
Posts: 26
Joined: Wed Nov 16, 2016 6:35 am
Country: Poland

Re: setOnchange for a grid inside a subform

Unread postby fibo2358 » Fri Nov 10, 2017 5:08 am

Hello,

Thank you very much for a workaround, it works fine.
I have reported a bug: http://bugs.processmaker.com/view.php?id=23764

Best Regards,
fibo2358


Return to “Developing processes & programming”

Who is online

Users browsing this forum: No registered users and 2 guests