- Sun Mar 03, 2019 5:02 am
#823210
Hi, i am new to processmaker. hopefully someone can help me to make total sub in text are outside from the grid.
this is the example i made to the dynaform unfortunately its not wotking. i've also attached the dynaform. please help.
#gridVar008 is the grid & textVar211 is subtotal text area.
Thanks
//Change backcolor
document.getElementById("form[approveBtn]").setAttribute('style','background-color:#228B22;width:150px;border:none;color:white;');
// function to round a number
function roundToFixed(_float, _digits){
var rounder = Math.pow(10, _digits);
return (Math.round(_float * rounder) / rounder).toFixed(_digits);
}
var sum =0;
for (var i=1;i<=$("#gridVar008").getNumberRows();i++){
if($("#gridVar008").getValue(i,2) == "1"){
$("#gridVar008").setValue((parseFloat($("#gridVar008").getValue(i,3))),i,4);
}
else{
$("#gridVar008").setValue(0,i,4);
}
sum=sum+$("#gridVar008").getValue(i,4);
}
$("#textVar211").setValue(parseFloat(sum));
// Approval comments hide/show
var approval = $('#approval').getValue();
if(approval=='2'){
$('#subtitle0000000003').show();
$('#approverComments').show();
}else{
$('#subtitle0000000003').hide();
$('#approverComments').hide();
}
this is the example i made to the dynaform unfortunately its not wotking. i've also attached the dynaform. please help.
#gridVar008 is the grid & textVar211 is subtotal text area.
Thanks
//Change backcolor
document.getElementById("form[approveBtn]").setAttribute('style','background-color:#228B22;width:150px;border:none;color:white;');
// function to round a number
function roundToFixed(_float, _digits){
var rounder = Math.pow(10, _digits);
return (Math.round(_float * rounder) / rounder).toFixed(_digits);
}
var sum =0;
for (var i=1;i<=$("#gridVar008").getNumberRows();i++){
if($("#gridVar008").getValue(i,2) == "1"){
$("#gridVar008").setValue((parseFloat($("#gridVar008").getValue(i,3))),i,4);
}
else{
$("#gridVar008").setValue(0,i,4);
}
sum=sum+$("#gridVar008").getValue(i,4);
}
$("#textVar211").setValue(parseFloat(sum));
// Approval comments hide/show
var approval = $('#approval').getValue();
if(approval=='2'){
$('#subtitle0000000003').show();
$('#approverComments').show();
}else{
$('#subtitle0000000003').hide();
$('#approverComments').hide();
}
Attachments
(121.88 KiB) Downloaded 269 times