Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

User avatar
By amosbatto
#826514
You can use grid.removeRow().

If you want to remove blank rows when submitting the Dynaform, add this JavaScript code to your Dynaform:
Code: Select all
//set to the column number of the grid field to check if blank; counting starts counting from 0:
var colNoCheckIfBlank = 3; 
var formId = $("form").prop("id");

$("#"+formId).setOnSubmit( function() {
  var oGrid = $("#myGrid"); //change "myGrid" to the grid's ID
  var aGridVals = oGrid.getValue();
  var aRowsToDelete = [];

  for (i = aGridVals.length; i > 0; i--) {
     //subtract 1 because array counts from 0, not from 1
     if (aGridVals[i-1][colNoCheckIfBlank] == "") {
        oGrid.deleteRow(i);
     }
  }
});           

Capture.PNG I have use this javascript code to ad[…]

Having a business, especially when it involves tra[…]

The condition is not workable

Hi there, Recently I've encountered the amount wh[…]

Yes i'm using vue js to load the data.