@jeffcrum and others, I have posted on flex-table-card GITHUB an enhancement request that IMHO would be killer. Please take a look at:
Read through to the end which has the current solution that works flawlessly in my setup. This enhancement would greatly enhance the use. It allows to import functions from a separate JS file that you can write to do very complex things. It is also especially useful in code repetition reduction so that changes can be made once to change many uses of the same pattern of JS snippets.
Please take a look, test if you like. Questions/comments always welcome.
I will never go back so if it is not put into the core product, I will just reimplement on each update to it. As an example for the Strength of Schedule post I did above. It reduces tons of repetitive JS to this:
columns:
- name: SOS
data: '[[attribute]]'
modify: |-
if (x[8] > 3 ){
'<div style="display:none;">'+ x[8] + '</div>' + '<div style="background-color:lightgreen;text-align:center">' + x[8] + '</div>'; }
else if (x[8] < 3) {
'<div style="display:none;">'+ x[8] + '</div>' + '<div style="background-color:lightcoral;text-align:center"">' + x[8] + '</div>'; }
else {
'<div style="display:none;">'+ x[8] + '</div>' + '<div style=";text-align:center">' + x[8] +'</div>'}
- name: Team
data: '[[attribute]]'
modify: |
plugin.sosteam(x)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,1)
- name: Monday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,1)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,2)
- name: Tuesday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,2)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,3)
- name: Wednesday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,3)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,4)
- name: Thursday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,4)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,5)
- name: Friday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,5)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,6)
- name: Saturday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,6)
- name: ' '
data: '[[attribute]]'
modify: |
plugin.sosind(x,7)
- name: Sunday
data: '[[attribute]]'
modify: |
plugin.sosopponent(x,7)