Change formatting of Table Row based on field value

2»

Comments

  • edited December 2, 2016
    I am using a very similar script on a table without issue. I could be mistaken but maybe change this line
    if ((field.mode == 'readonly') && (value2 === true))
    to
    if (field.mode == 'readonly' && value2 === true)
  • edited February 25, 2016
    Thanks. Just tried it but still didn't work unfortunately. 
  • edited March 3, 2016
    Hi Emily, I am having the same issue Matt did. The render is correctly applying the css class but the table won't change. Except I used your suggestions for the css selector already. CSS is: table.nx-skootable-data tbody tr.LeadTab_highlighted-row td { background-color: LightCoral; } Snippet is : var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]); skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value); if (field.mode == 'read' && value === true) { field.item.element.addClass("LeadTab_highlighted-row"); }image
  • Rob HatchRob Hatch 🛠️ 
    edited September 1, 2016
    If the class is being applied but you are not getting the expected results - it either is because the class is not defined correctly (and all the properties are getting thrown out) or it is because there is another div sitting on top of your special one that is blocking it. 
  • edited March 3, 2016
    Your second idea worked. There was a problem with the CSS used in a map I had on the page. I thought I had tested it without the map already. Works now thanks!
  • I want to do this but is there a new way or where can I find the sample page that was created. Link is dead

  • Chad - we moved things around in our Sample Page repo this year. Here is a corrected link to the Conditional Row Highlighting page:

    https://github.com/skuid/SamplePages/blob/master/xx_Holding/Conditional%20Row%20Highlighting%20(Lead%20List)

    A note. In our upcoming release we will be delivering declarative ways to do this in the V2 page api. We already have conditional styling that can be applied to components. So you could already change the background color of a form if "do-not-call" = true. But what is coming is targeting individual table fields or rows with this styling change.

    I don't know if you are exploring the V2 API at all - (I hope you are cuz its awesome!) - but you might consider that....

    Its good to see you here. I hadn't heard your name in a while... Hope the app is doing well.

  • thanks for the help. good to be seen

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!