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);
	 }
1 Like