David Huynh wrote:
> Douglas,
> 
> This is a "not-yet-implemented" bug: the view doesn't use the general 
> formatting facility to render the groups' labels. The problem is located 
> in the file
> 
>

David,

Thanks for the info. I'll try and come up with a patch early in the New 
Year.

Happy holidays,
Doug



> http://static.simile.mit.edu/exhibit/api-2.1.0/scripts/ui/views/tile-view.js
> 
> Look for the function
> 
>     Exhibit.TileView.prototype._reconstruct
> 
> Look for this code
> 
>     this._orderedViewFrame.onNewGroup = function(groupSortKey, keyType, 
> groupLevel) {
>         closeGroups(groupLevel);
> 
>         var groupDom = Exhibit.TileView.constructGroup(groupLevel, 
> groupSortKey);
> 
>         state.div.appendChild(groupDom.elmt);
>         state.div = groupDom.contentDiv;
> 
>         state.groupDoms.push(groupDom);
>         state.groupCounts.push(0);
>     };
> 
> Instead of
> 
>         var groupDom = Exhibit.TileView.constructGroup(groupLevel, 
> groupSortKey);
> 
> there should be
> 
>         var groupDom = Exhibit.TileView.constructGroup(groupLevel, 
> view._uiContext.getFormatter(keyType).formatText(groupSortKey));
> 
> But you'd also need to add the getFormatter method to the UIContext class
> 
>     Exhibit.UIContext.prototype.getFormatter = function(valueType) {
>         var f;
>         if (valueType in this._formatters) {
>             f = this._formatters[valueType];
>         } else {
>             f = this._formatters[valueType] =
>                 new Exhibit.Formatter._constructors[valueType](this);
>         }
>         return f;
>     };
> 
> David
> 
> Douglas Burke wrote:
>> Problem/question:
>>
>> Given a date, I can use the ex:formats attribute to change the format 
>> that the date is displayed by the lens (in this case I want to use a 
>> template of 'MMMM yyyy'). However, I can not get this format to be used 
>> when the date field is used to group items (e.g. I have a ex:role="view" 
>> with ex:orders=".date"). Have I not found the right incantation, or is 
>> this currently not possible? If not, where could I look to hack this in? 
>> I am using exhibit 2.1.0.
>>
>> Details:
>>
>> If you go to
>>
>>    http://hea-www.harvard.edu/~dburke/playground/w/test.html
>>
>> then you see that the items have been grouped by date, but the groupings 
>> use the value given in the data file rather than the format I believe 
>> I've told exhibit to use. You see
>>
>> 2007-02 (1)
>>
>>    Test 3
>>    Date: February 2007
>>    ...
>>
>> 2007-01 (2)
>>
>>    Test 1
>>    Date: January 2007
>>    ...
>>
>>    Test 2
>>    Date: January 2007
>>    ...
>>
>> but I expected the grouping labels to be "February 2007 (1)" and 
>> "January 2007 (2)" rather than "2007-02 (1)" and "2007-01 (2)" respectively.
>>
>> I've added ex:formats attributes to all the items with a ex:role 
>> attribute to try and get the format changed; I even added info to the 
>> data schema to try and force this but to no avail - see
>>
>>    http://hea-www.harvard.edu/~dburke/playground/w/test-data.js
>>    http://hea-www.harvard.edu/~dburke/playground/w/test-schema.js
>>
>> Thanks for any help,
>> Doug
>>   
> 
> 
> 


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to