ugly and unwanted: links in lookup

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1167
Joined: 2019-05-21 22:42
Location: Germany
Contact:

ugly and unwanted: links in lookup

Post by onoehring » 2021-01-11 17:09

Hi,

1. I am wondering, if there is a way (CSS?) to make links not show up "ugly" in a lookup field.
See the picture, the text after the : is made of individual links (first line: 1001665 is a link, 401Electronics is another link). You will notice, that the links after 414Tablet are not really visible.

2. Also: In this dropdown I would like to disable links (to prevent users from accidentally clicking on them. Is that possible?

l13.png
l13.png (39.14 KiB) Viewed 2225 times
Olaf

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: ugly and unwanted: links in lookup

Post by pbottcher » 2021-01-11 20:12

Hi.

for qustion 1: change the css

.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}

to something that fits for you.
Why do you need to show the links on the seletable items?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1167
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: ugly and unwanted: links in lookup

Post by onoehring » 2021-01-13 06:36

Hi pbötcher,

thank you.
I searched and found this - which can disable links using css. Pretty neat I think
Source: https://stackoverflow.com/questions/209 ... ss#4416239

regular HTML:

Code: Select all

<a href="link.html" class="not-active">Link</a>
and CSS

Code: Select all

.not-active {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  color: black;
}
On stackoverflow it says in the comments (deriving from 2013), that you can still tab to the link - which I can not. Probably the browser-problem was solved by now.

Olaf

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1167
Joined: 2019-05-21 22:42
Location: Germany
Contact:

SOLVED: ugly and unwanted: links in lookup

Post by onoehring » 2021-01-13 16:22

Hi,

thanks again for your help pbötcher.
I want to post this follow up as it might help others. Your css path brought me on track and using the CSS from above I was able to get it working.
In the following CSS I set red as background to make it easy recognizable. The links in the path (all words after the colon (:) ... >... >... are links) are disabled and the cursor stays the hand - works perfect. Once the user has chose an entry he can click on each individual link - which is fine for me, as I just wanted to make sure nobody accidentally clicks on any link while choosing some value from the lookup.

CSS used

Code: Select all

.not-active,
#select2-drop > ul > li > div > a  {
	pointer-events: none;
	cursor: default;
	text-decoration: none;
/*	color: black; */
}

.select2-results .select2-highlighted a {
	background: red;
	color: yellow;
}
Looks like this:
l14.png
l14.png (12.05 KiB) Viewed 1586 times
Once chosen:
l15.png
l15.png (3.43 KiB) Viewed 1586 times
Olaf

Post Reply