Skip to main content

I have a custom field renderer I like that compares the value of a given field with a benchmark value field and renders the cell on a table red if the value is unfavorable to that of the benchmark value. 

Now I’m trying to pull in data from another model into the table, and I’d like to use the same custom field renderer to compare the value of this new field to my benchmark and render some stuff if different. 

BUT, there’s no place to put my field renderer in a template field. I tried to hack the xml by adding snippet=“valueHighlight” to my template field in the xml, but no luck. 

Are there any ways to do this?

why dont you create a custom renderer that uses the custom template instead of the other way around?


Jack,

Depending upon your needs, a model ui field with an ‘if’ and ‘model lookup’ should work as well.

Thanks,

Bill


Me things you will need to create a second custom renderer.  Choose some other random field on your tables model and bind it to a custom renderer that finds the value from the other model and does the calculation and format manipulation you are interested in… 


Getting there! Thanks Bill for reminding me of Model_Lookup, it is working great to pull the value from my other model into my parent table. The one thing I had to remember was to put my other model FIRST in the model order. 

Now that pulling in the data from the other model is working, I can add a custom field renderer to it. I just need to adjust my field renderer. Currently I have a UI-Only formula field that has my logic in it, which is a complex series of if statements comparing the value of a field to a benchmark value. Then my custom renderer looks to that UI-only field and says if TRUE, render cell as red, and if FALSE render as green. 

So, in order to make this scale, I will need to move that IF logic into the field renderer itself, so it can work dynamically. It’s a little harder getting the if/then in Javascript than in the UI-Only formula syntax. 

Thanks everyone!


It is harder to do in Javascript - but so much more powerful… 


Reply