colymba / GridFieldGalleryTheme

Gallery view styling and functionalities of SS3 GridField
15 stars 10 forks source link

Adds i18n column titles support #15

Open a2nt opened 9 years ago

colymba commented 9 years ago

Sounds like a good idea but am just wondering, what is actually stored in $e.attr('data-title')?

a2nt commented 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.

colymba commented 9 years ago

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)?

a2nt commented 9 years ago

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. screen shot 2014-11-25 at 5 14 18 pm

colymba commented 9 years ago

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?

colymba commented 9 years ago

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.

a2nt commented 9 years ago

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?