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?
Answers:
Found out is the data issue. Cannot have space between the word.
"Grand Total"
change to "Grand_Total"
, then styling can function.
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?
Found out is the data issue. Cannot have space between the word.
"Grand Total"
change to "Grand_Total"
, then styling can function.