0

In the quickbase calendar report - highlight a blue bar for the length of time which is the .itme class. What I am hoping to do is to change the .itme class to the exact same style except a different color. Currently I am able to change my class as necessary but I can't upload a css color style to support my new class. Please see my latest in the code.

If(IsNull([Task Name])," ", [Task Name]="Vacation", "<img qbu=\"module\" src=\"/i/clear2x2.gif\" onload=\"javascript: var my_css_class = { backgroundColor : 'red', color : '#fff' };$('.itme').attr('class','my_css_class');\">Apple")
JuniorFlip
  • 417
  • 2
  • 7
  • 17

1 Answers1

0

The class attribute expects a class name that is defined in <style></style> tags so passing the definition directly is going to cause some kind of error. You could try appending a new set of style tags to the document with your class defined like:

<style>.my_css_class{background-color:red;color:#fff}</style>

I don't think that will work in this instance because the existing .itme class has color styling as part of it and I'm not sure how the browser resolves conflicting classes. You probably don't want to replace .itme entirely because it has a lot of other styling information like size and borders. Instead, I suggest you insert your styling directly in the style attribute because it will supersede the class where they conflict. Try something like this:

If(IsNull([Task Name])," ", [Task Name]="Vacation", "<img qbu=\"module\" src=\"/i/clear2x2.gif\" onload=\"javascript: $('.itme').attr('style','background-color:red;color:#fff');\">Apple")

I'm not sure what "Apple" is doing for you here but I left it in none-the-less.

Nathan Hawe
  • 281
  • 3
  • 5