DataTable Column formatting not updating on data change

I have a data table on which i have specified conditional formatting in a specific column. When the Dashboard is loaded the formatting is working absolutely fine.
But i have another datatable whose value on selected drive changes in the datatable having conditionally colored column.
The data is changing but the color/formatting isn’t getting changed.
How to overcome this?
Help, please.

Please share a minimal working example.

I have two Datatable A and B. The Data in B is derived when i click on the rows in A which i am doing using CustomJS callaback.
I have specified red green colors in one of the column in DataTable B(by checking >0 and <0 value) using HTMLTemplateFormatter.

Now when the Dashboard is loaded the color as per value of column is coming correct for initial view
But when data in Table B is changed as i click on rows in Table A the color is not updating.

Can i re render the column formatting in JS callbacks?

Answering this question without an example will make me spend way too much time. If you want help, please provide an example where the only thing that doesn’t work is exactly the thing that you want to be fixed.

templatecolor = “”"

<%= value %>
(function symbolfromint(){
if (change > 0)
{return(’ &#8679’)}
else if (change < 0)
{return(’ &#8681’)}
}()) %>

formatter = HTMLTemplateFormatter(template=templatecolor)
    columns = [
        TableColumn(field="lista", title="A "),
        TableColumn(field="listb", title="B"),
        TableColumn(field="listc", title="C"),
        TableColumn(field="listd", title="D", formatter=formatter),
        TableColumn(field="liste", title="E"),

How to dynamically refresh the format when data changes in datasource of table on click .
I have written a callback in CustomJS with source.change.emit(); which is changing the data in the columns but the conditional fromatting of column ‘D’ stays fixed with the intial color set on the column values when dashboard is loaded or opened

please help @Bryan @p-himik

@SubhamSharma1996 This forum is an all-volunteer effort, and participants are in timezones all over the world. There is no need to poke a thread less than two hours later. As gently as I can suggest this: there is no SLA here, and you should re-calibrate your expectations. Many interactions here may span days, as people are only able to respond in between other work and life priorities.

1 Like

Sorry for that.
Just was looking for help.

@SubhamSharma1996 No apologies needed, I just want to make sure expectations are in line with what’s possible. As @p-himik mentioned above, what would really help is for you to supply some minimal, complete code to start from. Asking other people to try and help without that context always risks misunderstanding, and in particular risks that time and effort is spent, only to solve the wrong problem. With so many help requests, that risk adds big disincentive to prioritizing vs other questions (just being completely up front)

I gave a sample example and also posted the code part.
Due to my organisational restrictions i cant upload the entire code base.

I want help in knowing how can we change column formatting using call back.

You don’t need to post the full code created on behalf of your organization.

What’s need is a very small and runnable example that I can just copy and run without modifying it. So it has to include even the imports.
If such an example can be very small, then you will have no problems in creating it in your spare time, thus making the organizational restrictions irrelevant.
If such an example is required to be pretty big, then I cannot possibly recreate it myself relying just on the isolated code blocks above.

1 Like

@SubhamSharma1996 This document from Stack Overflow might do a better job of explaining the what and why of making an MRE than I have: