Can I customize the LayerList widget to add non-interactive descriptive text lines between layers listed.

3398
32
Jump to solution
01-19-2018 12:48 PM
BenjaminGrover
New Contributor II

I've seen some talk about this in other discussions, but no solid solutions.  Where would one need to add code to insert text lines between layers in the LayerList widget?  I'm wanting to add some descriptive text, smaller font, bolded, and in red, below a few layers listed in the Widget. Can this be done??

0 Kudos
32 Replies
RobertScheitlin__GISP
MVP Emeritus

Brain,

  The only thing I can think of is some syntax error in the style.css...?

0 Kudos
BrianDudek1
New Contributor III

hmmmm.  the height property works, but not color or font-size.  :shrug:

.jimu-widget-layerList .desc{
  height: 10px;  /* Working- spacing between former and latter layer */
  color: #00ffff;  /* Not working */
  font-size: 11px; /* Not working */
}‍‍‍‍‍

I am not too worried about it, since I was just exploring some possible WAB functionality edits, but was curious anyway.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brian,

   OK, if part of your css rule works but other properties do not then there is a css rule elsewhere that has higher specificity then your rule. You can force the color by adding !important

.jimu-widget-layerList .desc{
  height: 10px;  /* Working- spacing between former and latter layer */
  color: #00ffff !important;  /* Working */
  font-size: 11px !important; /* Working */
}
BrianDudek1
New Contributor III

Good to know good to know.  Doesn't do anything in this situation though.  I can change the color obviously with HTML in the innerHTML part of divLabel. Anyways, I need to start reading more and practicing. 😃

0 Kudos
BenjaminGrover
New Contributor II

I also have web app builder. 2.0 developer edition, I haven't take then time to upgrade.  Just hit me that the LayerList widget has seen some changes in more recent releases, could this be my issue?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

That is the most likely issue (version). The code I provide was for 2.6.

0 Kudos
BenjaminGrover
New Contributor II

Downloading 2.7 right now. Do you suspect they are the same?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

very likely.

0 Kudos
BenjaminGrover
New Contributor II

version 2.7 seemed to make no difference. I got the same error.  

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ben,

   Hmm.. you must have introduced a syntax error in the widgets code then.

0 Kudos