Closed CMH-Benny closed 3 months ago
Hey!
I would have answered in the https://github.com/Kreyu/data-table-bundle/issues/107, but it was closed and I guess this is the best way to cantact you?
I'm getting notifications even on closed issues, so you can comment on those as well (if related, of course), and I can reopen them if necessary π
However URL remains without params when I come back to the datatable page, so persitence is read successfully all filters are there and work, but the URL is not overwritten, anything I can do to help to understand the issue?
Are you using a custom theme that modifies the base kreyu_data_table
block? The turbo-frame
should contain a data-kreyu--data-table-bundle--state-url-parameters-value
param with JSON-encoded URL parameters. Or maybe those are empty in your case?
The url_query_parameters
variable should be accessible inside the view of your data table - you can check it by dumping the data_table.vars.url_query_parameters
(assuming DataTableView
you are passing to the view is named data_table
). Its contents are generated in the base DataTableType
:
Thanks for the fast reply! <3
I'm getting notifications even on closed issues, so you can comment on those as well (if related, of course), and I can reopen them if necessary π
Sadly no, the comment button was disabled, so i couldn't put the reply there, else that would have been my choice, maybe it is some kind of setting to allow that specifically?
Are you using a custom theme
Yes I do, but I don't override those blocks and I checked my HTML and all necessary attributes are there. I debugged into the JS code and it seems that for some reason it can't read the this.urlQueryParametersValue
however, the attribute itself has a string with the filters:
<turbo-frame id="kreyu_data_table_my_table"
target="_top"
data-controller="kreyu--data-table-bundle--state"
data-kreyu--data-table-bundle--state-url-parameters-value="{"filter_my_table":{"search":{"value":"Test"}},"page_my_table":1,"limit_my_table":25}"
>
So for some reason the conversion to an object seems not to work on my side, it's an empty object even tho there is a proper data attribute available, maybe it somehow can't parse the string and thus returns empty object?
Dammit, the HTML attribute is named ...url-parameters...
instead of ...url-query-parameters...
, I swear it somehow worked before I published a release (or I forgot to rebuild assets after changing the naming) π
Should be fixed in 0.21.1, thanks for reporting the issue!
Sadly no, the comment button was disabled, so i couldn't put the reply there, else that would have been my choice, maybe it is some kind of setting to allow that specifically?
Hmm, I've had multiple issues in this repo with people commenting on already closed issues, so I'm not sure. Although, thanks for the info
Dammit, the HTML attribute is named ...url-parameters... instead of ...url-query-parameters...
Oh, wow even I didn't see it, I debugged into it, I tried to adjust the json_encoded string to see if something changes, and I also checked that attribute, but because it's so long I also didn't realize there is a -query-
missing in between - Good catch!
thanks for reporting the issue!
Thank you for taking a look and fixing it so fast, I updated it and now it works perfectly fine, for filters, pages and sorting, thank you so much <3
Hmm, I've had multiple issues in this repo with people commenting on already closed issues, so I'm not sure. Although, thanks for the info
Actually you are right, I am just plain dumb, the button was disabled, but it was because I didn't put any text into the box π€¦ββοΈ I can't really tell why I didn't even realize there is the comment box, it was like it doesn't exist in that moment, kinda worrying. So sorry that I created the new issue here for no reason in the end, next time I will stick to the existing issue π€π
I will hit close and comment now, all looking good πThanks again!
I updated to latest version in order to test the restoring of filters. Filter Buttons work now as expected perfectly fine! Thank you for fixing this. I would have answered in the other issue, but it was closed and I guess this is the best way to cantact you?
I updated to the latest version and after some adjustments it seems to work fine in my project.
So I added the following to my controllers.json:
I do see the controller to be executed:
However URL remains without params when I come back to the datatable page, so persitence is read successfully all filters are there and work, but the URL is not overwritten, anything I can do to help to understand the issue?
Steps to reproduce (on my end)