OL Learn

Hide row in dynamic table if

image below of my dynamic table

I need to hide a row if a field contains nothing or 0 etc. For example in row 3, Exemption(@COLUMN51@) - if “COLUMN51” is equal to nothing or 0, i need that row to be hidden. Is this possible?

I was thinking about doing this in a text script but the layout wouldn’t be laid out like a proper table.

Sure, in your text script you can simply make your comparison and then select the closest TR to hide it.

Below is an example from a detail table.

results.each(function(index) {
	var field, result = "";

	field = record.tables["detail"][index].fields["UnitPrice"];
	if (field == "" || field == "0"){	
	 	this.closest("tr").hide();
	 } else {
	 	result += field;
	 	this.html(result);
	 }	

});

You appear to be using a fixed table, however, so maybe this would be more meaningful in your case:

var field, result = "";

field = record.fields["Address2"];
if (field == "" || field == "0"){	
     	results.closest("tr").hide();
	 } else {
     	result += field;
     	results.html(result);
	 }
2 Likes

The Fixed table piece works great!

The Dynamic table piece is not working for me unfortunately.
If I only have a single column it works, but fails if I have multiple columns

I have two cases with a similar ask

  • 2020.2 using a Dynamic Table with 4 columns, but need to hide the entire row if there is a null value in column 1
  • 2018.1 using a Dynamic Table with 3 columns, but need to hide the entire row if there is a null value in column 2