Since Display Rules in Fields have a priority (top to bottom) it’s extremely annoying that it’s not possible to rearrange them. I already have to setup Display Rules for every single column manually and when I need to change the priority I need to to delete all of them and redo it. This is tedious. I’d love to see a function to add Display Rules to multiple Columns at once and to rearrange them, best case also for multiple columsn at once.
Hi Andreas,
This might help you as im not clear on what the issue is but for default ‘sort by’ on multiple fields you can do that on ‘data source’ as shown below aslo have you tried adding filters?
It’s about display rules in fields. Not about component sorting
Do you have any screen shots or other details to share?
These are display rules for a single field in a table component. These are executed from top to bottom. So if your first Rule and last Rule would have identical conditions the action of the last one is executed. eg. I have a an Event “Rehearsal on Main Stage”. The first rule is “Event contains Rehaersal: Background Color blue”. Next I test Event for “contains Main Stage: Background Color purple”. The event then will be purple. This way I have marked all rehearsal events and rehearsal events with a room specified are a different color again.
Setting these up for every field is a tedious process and changes are hard to implement since the rules cant be rearranged.
Cant be done without code.
Yeah I know that’s why I created this as a feature wish
This might help to get you half way to final solution:
- Add a short text field to your ‘Daysheet Data Table’ and name this field ‘color_hex’
- Optional, set default form value to most common condition ‘show’ and set to #f7c27c.
- Create ‘table rules’ for table mentioned in step 1 and on ‘created or edited’ with condition when ‘Ereignis’ contains ‘rehearsel’, set ‘color_hex’ value to #80ffff
- Ask @Chem, @GREDDIE or @SuiteUpstairs if they can create a bit of code to set tr to ({color_hex}) value.
@SafetyUniversity Adam please can you help with above. Trying to change table row color to color_hex field value.
Hi @Shumon -
The issue is the order of your Display Rules. Display Rules work the same was as Form Display Rules, Record, and Table Rules. They work from the top down. Based on the image the issue appears to be the “is not blank” rule. The rest of the rules are based on dynamic text which shouldn’t be an issue (you may have to play around with them).
Try to place the “is not blank” to the bottom of the display rule list. If that doesn’t work you may have to remove it. What I have done in the past is start with on display rule, test, confirm, add another display rule, test all options, then repeat for the amount of rules you want.
Display rules can be very complex with the more rules you have. You will ultimately have to play around until you get an order that works.
Now, to address the table row coloring, you will not be able to use a single set of Display rules in a single field to span the color across the row. You will have to duplicate the display rules that work into each column of the table.
Alternately, you could have a coder create some javascript to color the row based on field results or try the Dynamic Table Row Coloring plugin (Plugin Dynamic Table Row Coloring | Tadabase).
Hope this helps,
Adam
Asked ChatGPT for the other half of the solution. Here it is, change component and field number to match your parts. add following code to page JavaScript:
Code:
TB.render(‘component_3’, function(data) {
setTimeout(() => {
// Select all rows in the table
var rows = jQuery(‘tbody tr’, data.ele);
rows.each(function() {
// Get the color hex value from the field (assuming the color_hex field is in a
specific column, say “component_3_field_color_hex”)
var colorHex = jQuery(‘td.component_3_field_818’, this).text().trim();
// If the colorHex is a valid hex color code, apply it to the row
if (colorHex.match(/^#[0-9A-F]{6}$/i)) {
jQuery(this).css('background-color', colorHex);
}
});
});
});
He @all,
I think you are all over-complating.
What @andreas asks if there could be a drag and drop, so you can rearrange the order of an existing set of rules. Now that feature is missing. This is about UX for the developer.
I support the request. Drag and drop of the rules so you can change the order, would really help the citizen developer save time.