Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By wysiwyg
#784837
Hi, Could someone please share some working code for a dropdown box in a grid.
For example, have the selected value in a dropdown box be displayed as a Javascript alert.

I've tried the examples from the wiki, but cannot get it to work in a grid.
By MickyRamirez
#784872
Hello wysiwyg,

Now we are working on JS Helpers in Grids, as you can see the wiki of ProcessMaker, the function setOnChange is not implemented yet, but we are working now on this. if you tell us what do you want to use this for, maybe we can try a work around, or thing about any possible way to accomplish what you want. Just let us know.

Greetings.

Miguel Ramirez
Software Quality Engineer
ProcessMaker
By ekaboom
#787710
MickyRamirez wrote:the function setOnChange is not implemented yet, but we are working now on this.
Is setOnChange implemented yet? if so, in which version was it implemented and working?
By ekaboom
#787765
Thank you. I am still curious if/when setOnChange is/was implemented. Because even when I try to make a textbox become disabled when a checkbox is checked and both are outside of the grid, it's still not working for me. But maybe my code is wrong too. Here is what I have to try to make a text box disabled when a checkbox is checked (again both are outside of any grids):
Code: Select all
function enableDisableText(newVal, oldVal) {
  if( newVal === '["1"]' ) {
        $("#storysource20").getControl().attr('disabled', true);
    } else {
        $("#storysource20").getControl().attr('disabled', false);  
    }
}
$('#checkboxVar001').setOnchange(enableDisableText);
This doesn't seem to work on my install (3.0)
By MickyRamirez
#787884
Hello ekaboom,

Well, we already tried this code on a 3.1 environment, you can try this:
Code: Select all
$('#checkboxSet').setOnchange(function(newv,prev){
  if(newv == '"1"'){ 
  	$("#dropdownJS").getControl().attr('disabled', true);    
  }  
});
Could you check it, please.
By ekaboom
#787886
Thanks for testing that out for me. It's strange. I replaced the old code with this new one and it still doesn't appear to be working.

Unless I am missing something.

I took your code and of course I replaced checkboxSet with my own checkbox field ID

and I replaced dropdownJS with both a textbox and then tried a dropdown box and neither were disabled when the checkbox was checked.
Code: Select all
$('#storyapproved001').setOnchange(function(newv,prev){
  if(newv == '"1"]){ 
     $("#storysouce1").getControl().attr('disabled', true);    
  }  
});
I also tried changing this line
Code: Select all
  if(newv == '"1"'){ 
to this
Code: Select all
  if(newv == '["1"]'){ 
If it's working on your 3.1 PM i don't know why it wouldn't on mine.

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]

To convert MBOX to PST, start by downloading and i[…]

My Assignment Services stands out as one of the be[…]