Failed when using the filter_query in style_data_conditional in dashtable

Question:

Trying to use the filter_query in style_data_conditional to styling certain row in the dashtable. However, receive the error message.

Referring to the Highlighting Text that Equals a Value

Error message:

DataTable filtering syntax is invalid for query: {column1} = "Grand Total"

(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser’s console.)

Code:

style_data_conditional=[{
                         'if': {
                                'filter_query': '{column1} = "Grand Total" ',
                                # 'column_id': 'column1'
                            },'backgroundColor': 'tomato',
                               'color': 'white'
                                                        
                         },]

Anyone know how to solve it or any advise on how to styling the row in dashtable?

Asked By: beginofwork

||

Answers:

Found out is the data issue. Cannot have space between the word.

"Grand Total" change to "Grand_Total", then styling can function.

Answered By: beginofwork
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.