TextColumn action not working as expected
This code should set the column description after clicked on the title text
but it will set the 'Test' description for all title columns together
This code will set "123" as the description for all title columns
if I try to change the clicked column state using the action method it will set all title columns together to same state
21 Replies
Can anybody help me please?
Do you mean all rows, right?
I think you could use a
description
column in your model to achieve what you need
Yes, after click on the title to active action and set the description only for that column the description set for all rows!
I just want to show the description for one specific column only after I clicked on it
Thanks for the reply
⬆️
What are you actually trying to do? Why does a column need to show or hide a description on click?
Just seems an odd use case to me.
I have a text column that I want to display the translated text when clicked, with the translated content sourced from database or an API.
Just trying to show the translated text in the description
Right but why does the description need to be based on a click, vs just showing it?
Seems like a needless step.
Uniformity i suppose 😋
Well, just showing the description would be more uniform to me.
one description has 5 paragraphs, the next 0, the next 12, the next 4, the next 5 etc. I would prefer uniformity too. I guess you could limit them all by default and on click reveal it 😊
Why make the user click when it could just be shown if it exists.?
Because I don't need all columns to display the translated text, loading all of them together would result in excessive requests to the API
Why? The data is what it is. The language should only matter to the app’s locale.
If the app locale is en then why do you need to show table data in a different locale relative to the user.
The texts are in all languages and some of them need to translate to english in realtime it's not based on the app local
But that doesn’t make sense.
If the user is logged in as en then the data should be in en.
It's only for admin panel not users
it's more than 2M data 😅
Right but, what does admin have to do with the locale of the logged in user.
I’m an admin who speaks Spanish, then I should see everything in Spanish. I’m an admin in English I should see everything in English.
I think you might be missing the underlying point of i18n
And I could be completely wrong, but it feels like a disconnect to me for the UI
Right but I just need some of the data to translate using the external API there is no need for me to translate all at once 😁
But that’s exactly how i18n works.
beside this why the code doesn't work? it's a simple code
am I missing something?
It doesn’t work because you’re not compensating the app locale to the logged in user or you don’t have a middleware in place to reset it.
This is a laravel concern and not necessarily related to filament.
no I mean this code it's not about localization or translation
Just want to show the description for the column I clicked on it but it set 'Test' as description for all rows columns