Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By heemalkumar
#818381
Hi Team
How do I limit a Grid to only 10 rows. And after 10 rows, you cannot add any more lines and get a error.
Please advise.
User avatar
By amosbatto
#819314
If you want to do it with PHP, then set the following trigger to fire before the DynaForm which holds the grid:
Code: Select all
@=myGrid = array();
for ($i = 1; $i <= 10; $i++) {
    @=myGrid[$i] = array();
} 
Then, uncheck the option in the grid's properties to add rows. That way the user can delete rows, but can't add any.

If you to do it with JavaScript, then you can use this code:
Code: Select all
$("#orderGrid").onAddRow( function(aNewRow, oGrid, rowIndex) {
  console.log(rowIndex);
  if (rowIndex > 10) {
    $("#orderGrid").deleteRow(rowIndex);
    alert("No more than 10 rows are allowed.");
  }
});

Web3 development encompasses creating decentralize[…]

The Upland Clone Script, offered by Dappsfirm, rep[…]

Dappsfirm offers a bet365 clone script that mirror[…]

🚀 Tauchen Sie mit Immediate Alora AI in die Welt d[…]