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

Moderators: ArturoRobles, ArturoRobles

By AbbesMA

I have a grid and a text column in this grid, i would like if i click on a row in this column to execute à Javascript function.

User avatar
By amosbatto
You can use JavaScript code like this in your DynaForm to set an event handler for a column in a grid:
Code: Select all
var gridId  = "clientList"; //set to the ID of the grid
var fieldId = "lastName";  //set to the ID of the field in grid

//set click event handler when the DynaForm loads for any existing rows in the grid:
var nRows = $("#"+gridId).getNumberRows();

for (var i = 1; i <= nRows; i++) { 

//set click event handler when a new row is added:
$("#"+gridId).onAddRow(function(aNewRow, oGrid, rowIndex) {

//click event handler function to display an alert if the field is left empty:
function clickHandler() {
  var rowNo = $(this).prop("id").match(/\]\[(\d+)\]\[/)[1]
  var val = $(this).find("input.form-control").val();
  if (val == '') {     
     alert("Row "+rowNo+" needs to be filled.");
Change the ID of the grid and the field inside the grid to match your DynaForm. Here is a sample form with the code that you can import:
(2.5 KiB) Downloaded 244 times

I use PM 3.4. Android push works while IOS push do[…]

[quote=ziadeh post_id=823031 time=1550759948 user_[…]

I have to support reports in processmaker 3.4. A s[…]

The link no longer exists because PM only supports[…]