Maybe it's time to start defining some object-oriented programming model
for exhibit.
What if we definedan "attribute handlers" architecture for new exhibit tags.
Any developer could write some javascript that registered a particular
method (function) on a particular new exhibit tag.
When exhibit encountered that tag while parsing, it would invoke the
method, passing in the object being constructed (view, facet, lens,
content) that included the tag, and also the argument associated with
the tag.
So in your example below, you would register a tooltip-callback
function, which would be invoked whenever ex:tooltip appeared in a
facet, and get passed that object representing the facet and also the
value of the ex:tooltip attribute.
David Huynh wrote:
> kumarachi wrote:
>
>> Hi,
>>
>> Is there any way to display a tooltip on hover on an item in a facet?
>>
>> I have long names and Acronyms...i want to display the acronyms in the
>> Facet, but show the long name on hover.
>>
>> is this possible?
>>
>> I am guessing it is possible, using something like ex:tooltip, but
>> with api-2.0, this directive is not being recognized.
>>
>> I have tried also just adding 'title', which works, but I am not sure
>> how to reference the long-name, from my data.
>>
>> <td><div ex:role="facet" ex:expression=".acronym" ex:facetLabel="Name"
>> ex:showMissing="False" style="width:160px;" title=.long-name></div></
>> td>
>>
>>
> Kumarachi,
>
> The facet doesn't support ex:tooltip, but that's a good idea.
>
> Right now, you could use the "formatter" attribute to do what you want
>
> <div ex:role="facet" ... ex:formatter="titleFormatter"></div>
>
> <script>
> function titleFormatter(elmt) {
> var label =
> $(elmt).find('.exhibit-facet-value-link')[0].firstChild.nodeValue;
> var longName = window.database.getObject(label, "long-name");
> elmt.title = longName;
> }
> </script>
>
> Let me know if that works.
>
> David
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---