Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi Stephanie,
Sorry for late reply, let say your form grid ID is "fg_approver".
And this is the step of jquery function:
$('[name="fg_approver"]').find('table').each(function() { var approver =""; $(this).find('.grid-cell').each(function(){ approver = approver + ';'+$(this).text(); }); }
Next set the value of "approver" variable, to the hidden field using another jquery
$('[name="hiddenFieldID"]').attr("value",approver);
You can add checker inside the each function just in case the value is undefined or empty, the complete code is like this:
$('[name="fg_Approver"]').find('table').each(function() { var approver =""; $(this).find('.grid-cell').each(function(){ if ($(this).text()!==undefined && $(this).text() !=null && $(this).text() !='') { approver = approver + ';'+$(this).text(); }; }); if(approver!=''){ $('[name="hiddenFieldID"]').attr("value",approver); } }
Set the code event to run when user click submit.
Note: the code above is workable, but you can modify it to make it more perfect.
Below is a jquery reference for you:
Hope it helps
What do you mean "I would want the approvers to be bbrown, and jsmith". is it both must approved first then the process run again. or just one of approver need to approve?
If it just one (bbrown or jsmith), Usually to accomplish this kind of requirement, in the form I create a hidden field, that mapped to a workflow variable. The participant mapping, is mapped to workflow variable username.
Then back to the form I add a custom html field, that contain a jquery that filled the hidden field each time a row is added, then seperate per username by ";".
Hi Yonathan, Can you show an example of the jquery that is used to populate the hidden field? I am having trouble getting it to run every time the row is added and accessing the hidden field to set its value. Thank you!
We are evaluating if Joget can be used for our workflow requirements.
For one of the projects we have, we need to be able to have a variable number of participants, specified at runtime by the user (through the form).
To test this, I am tweaking the example here: Multiple Approval
But instead of having the users mapped in, I want to use the values that a user enters in through a form:
ex:
I would want the approvers to be bbrown, and jsmith. I vaguely know how to map to users and groups from workflow variables, but how do I get the username values in the grid to be stored into those variables in the first place?
Details would be greatly appreciated!