Page 1 of 1

hr not being hidden

Posted: 2022-02-23 14:07
by angus
Hi Jan, I have the following working

Code: Select all

var row_1 = dv.addLayout([3,3,3,3])
	.add(1, ["-", "Name"])
	.add(2, ["-", "Address"])
	.add(3, ["-", "City"])
	.add(4, ["-", "Postcode"])
	.wrapLabels();
I have 10 rows like this and I hide them if they are empty. Only problem is the <hr> which is created with the "-" is not hidden. I try to use

Code: Select all

$j('#hr').hide();
but this does not work. do you know what would?

Re: hr not being hidden

Posted: 2022-02-23 14:27
by jsetzer
Well, this question is more a jQuery question than an AppGini Helper question.

Anyway, I'm pretty sure you are using a wrong jQuery selector.

Your selector $j("#hr") will return one element having id="hr", for example <div id="hr">...</div>.

This is not what you want. Try a different selector:

Code: Select all

$j("hr").hide();
This will hide all <hr> tags.

If you want to hide all hr's inside a certain container (for example inside a certain div), you will have to find out the selector of the container, first, then can get all hr-children.

I can only give an example, because I don't know your specific layout and HTML code.

Example

Code: Select all

$j("#TABLENAME_dv_form > fieldset > .form-group > div > hr").hide();
Here is a link for a totorial about jQuery-selectors:
https://www.w3schools.com/jquery/jquery_selectors.asp

Re: hr not being hidden

Posted: 2022-02-24 12:18
by angus
perfect I will give it a go, thanks