Fragment Presenter Help

When using fragment_presenter.set_setting('','')

is it possible to reference a property in a sub array ?

    [message_offline_mode_unique_lookup] => 
    [wrapper] => 7
    [presenter] => 75
    [label] => Mandatory Conditional
    [hint] => This shows the percentage of mandatory conditional fields completed correctly.
    [required] => 0
    [nonautoinput] => 0
    [interactive_column_visibility] => disabled
    [presenter_settings] => Array
            [progress_bar_width] => 50
            [progress_bar_percentage] => 1
            [color] => success
            [progress_bar_range] => 0-100
            [progress_bar_min] => 0
            [progress_bar_max] => 100

    [display_on_small_devices] => 1
    [display_on_medium_devices] => 1
    [display_on_large_devices] => 1
    [callback] => CSC0000193FEFDF1
    [message_offline_mode_callback] => 
    [custom_css_class] => no-table-header

For example I want to set “color” on a progress bar ?

Ive tried the obvious things but nothing seems to work for me.

im sure its obvious but my brain is not working today :joy:

You should be able to, but you will need to set the whole array I think. Try this approach, assuming this is within a Fragment Callback…

let settings = fragment_presenter.get_settings(); settings.presenter_settings.color = 'warning'; fragment_presenter.set_setting('presenter_settings', settings.presenter_settings);

1 Like

As a side note, on a Progress Bar you can use “Conditional Highlighting” in the page builder settings to change it’s colour based on subset, so you may not need this code at all depending on what you are trying to do with it.

1 Like

Many thanks for the reply - that helps a lot.

Good call on the conditional highlighting as well - had overlooked that as a possible solution.

Figured as I was doing a fragment callback anyway for some other things I would just load everything in together.

All good now - thanks for the input. Works like a charm !!