AG-Grid how to set filterParams #255
-
Hi, I am trying to set filterParams. Here is the JS code: const columnDefs = [
{
field: 'athlete',
filter: 'agTextColumnFilter',
filterParams: {
buttons: ['reset', 'apply'],
}, How can I adapt the code for NiceGUI? This is one of my tries: "columnDefs": [
{
"headerName": "My Header Name",
"field": "my_header_name",
"filter": "agTextColumnFilter",
"filterParams": "{buttons: ['reset', 'apply']}",
}, Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jan 18, 2023
Replies: 1 comment
-
As long as your filter params are JSON-serializable, you can simply set them as a dictionary: ui.table({
'columnDefs': [
{
'field': 'name',
'filter': 'agTextColumnFilter',
'filterParams': {'buttons': ['reset', 'apply']},
},
],
'rowData': [
{'name': 'Alice'},
{'name': 'Bob'},
{'name': 'Carol'},
],
}) On the other hand, setting functions like a comparator does not work with the current version of NiceGUI. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cryptedx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As long as your filter params are JSON-serializable, you can simply set them as a dictionary:
On the other hand, setting functions like a comparator does not work with the current version of NiceGUI.