# Highlight rows of a table that meet a certain inactive model condition?

Matt Sones
πππ

I have a toggle filter on a table. When the filter is off so that all rows are shown, I'd like the rows that meet the criteria for the condition behind the filter to be highlighted or bold.

Any thoughts on the best way to accomplish this?

Thanks!

Any thoughts on the best way to accomplish this?

Thanks!

1

#### Categories

- 4.9K Questions
- 914 Ideas
- Discussion Categories
- 97 General
- 7 Community Feedback
- 3 Community Info
- 6 Knowledge Base

## Comments

if(row.Condition_Field__c == whateverVal){

Β Β highlightRow

}

Trouble is the condition I want to evaluate is the following subquery condition. Do I have to perform the subquery in javascript every time, or is there a better way (access the 'value' of the condition through the model somehow?)

1) Create a model on the Signature__c object, and recreate the subquery criteria as conditions on this model, set this model to NOT load data on page load, and LIMIT 1, call it "Signature".

2) Have an additional condition where Interaction__c = "Empty_Value" filterable default off, name this condition "Interaction".Β

3) In your snippet, get the Id value of the current Interaction row. Then set this as the value for the "Interaction" condition.

e.g. PROS: This just may work

CONS: If you have more than a couple of rows, it will take forever for the page to load...

1) Clone your Interaction model and call it "InteractionSubquery".

2) Change the subquery to always be on.

3) In your snippet, check if the current rows Id exists in the model that has the subquery on, that will indicate that it matches the criteria :

e.g. PROS: This should work awesomely

CONS: None that I can think of

CONS: Β None that I can thing of!Β

For posterity, here's the code I'm using for a field renderer. I made it generic enough to use it on tables with different models. To use it, you just need to clone your models such that if your table's model is MyModel, your clone is MyModelBold.