-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set columnFilter options programatically #475
Comments
@Jakobovski the column filter dropdown menus are not tied to Column filter dropdown menus are tied to the actual Updating serverParams.columnFilters is going to modify the filter query being sent to the server, but without modify your actual column object, nothing is going to change in the ui's column filter dropdown. |
Within the CRUD operation that is determining the current url's query string, bind those query string properties to data property(s). Then, within columns -> filterOptions -> filterDropdownItems, inject those data object(s) in place of/in addition to the default dropdown options. That is a very brief explanation that isn't fully thought through, but that should work. |
@ow-en I think you misunderstood, probably because I explained my issue poorly. I dont want to change the filterOptions. I want a way to programmatic change the selected filter value in the UI. EX: status=SUCCESS in the url params, I want to grab that and set the filter on the success column to be SUCCESS. Right now i can easily update the request that goes to the server, but change the item that is actually selected in the UI is tricky and I cant figure out how to do it. |
@Jakobovski can you show me how you're setting the filters options? I have a feeling this is about vue reactivity rather than VGT issue. |
@xaksis Yeah it may be. I ended up doing the following
This seems to only work inside vuejs created(). |
Alright! phew... turned out the built files were stale so my changes were not reflected. Remember that you will have to use either
You can put this code in mounted or after and it should still work. |
Issue Type
It would be great if there was a way to programmatic set/update the columnFilter options. When I update the
this.serverParams.columnFilters
it does not update the UI dropdown menus.The use case for such a feature is as follows:
A user navigates to a page
/mytable?page=1&name=bob
and I want to take the query parameters from the URL and set the filters with them. This must work for both navigating back/forward and full page loads.The text was updated successfully, but these errors were encountered: