Open a2nt opened 9 years ago
it's just adds an ability for the other modules to set column titles at the GridFieldGalleryTheme cuz u can't use non-latin class names of course it needs further extension to get object column titles from the header of the GridField.
So does that mean the dev/user will have to manually add the data-title
attribute to the column or does it get added automatically?
If it's not automatic I had rather find an alternative, either grabbing the gridfield column headers since those will be translated, or using the databoject's summary fields somehow (maybe building the tooltip data from those and storing this as a json hash)?
yes it does actually I have GridField extension witch replaces default GridField and sets this attribute. I agree that we can do it automatic by grabbing the gridfield columns headers. JSON hash and summary fields looks like an excessive way to do it. Also I propose an additional fix to make elements in tooltip clickable something like at the screenshoot.
So for $e.attr('data-title')
to have the right data in, user would have to use another component, seems a bit much for something so simple. I had rather have it work out of the box.
For the clickable tooltip item, this should work (maybe?) if there is a column in the GridField with a tick box or something since the tooltip is built up with the columns content?
Just thinking now too, the JSON hash might actually be the best solution, since we would be depending on any other component, including core ones like sortableHeaders etc since these might be remove by the use.
Well I thought that the other component developers will use this option to set titles of custom fields for an instance you can see relation editor checkbox at the screenshoot.
As for tooltip if we will make tooltip a child element of the item row it won't be hidden when mouse gets to tooltip (it will be inside the row) and it will be clickable or editable if the other components will add a text field.
Do you mean to store JSON hash as html attributes?
Sounds like a good idea but am just wondering, what is actually stored in
$e.attr('data-title')
?