Not certain I am parsing either of your questions correctly, but:

On Sep 15, 7:57 am, James Cummings <[email protected]> wrote:
> Hiya,
>
> I have some json I'm feeding into a simile exhibit where the items in
> the list currently look like:
>
>  {
> label:    "8  January  1790",
> type:   "Meal",
> id: "m1790-01-08_dMeal_D",
> URI: "/diary/1790-01-08.html",
> subtype: "Dines",
> date: "1790-01-08",
> participants: [
> "HOL04",
> "UnCoded",
> "KIP01",
> "UnCoded",
> "HOL02",
> "HOL03"],
> numParticipants: "6",
>  },
>
> What I'd like to do in the script producing this json is for each of
> the participants  list items e.g. "HOL04", provide a label.  What
> should the json look like for exhibit to use the code HOL04 for
> counting but use a pretty version like "John Hollins" for display in
> the facet that is displaying the participants?

You can make each code the id of an item whose label is the pretty
name:
{type: "participant",
 id: "HOL04",
 label: "John Hollins"}

then the label instead of the id will be used in the facet
>
> A second question is about the label and dates:  This is a pretty
> version of the date item.  When I click on the label column in table
> view it sorts this as a basic alphanumeric string.  Is there a way I
> can say sort the label column by using the date column?   The
> viewPanel definition looks something like:
>
> ====
>   <td ex:role="viewPanel">
>                      <div ex:role="view" ex:viewClass="Tabular"
> ex:label="Tabular View" ex:columns=".label, .type, .subtype,
> .numParticipants, .date, .participants" ex:columnLabels="Meeting,
> Type, Subtype, Number of Participants, Date, Participants"
> ex:columnFormats="list, list, list, list, url, list" ex:sortColumn="4"
> ex:sortAscending="true" ex:paginate="true" ex:pageSize="10">
>                         <table>
>                            <tr>
>                               <td><b><a ex:href-content=".URI"
> class="link"><span ex:content=".label"></span></a></b></td>
>                               <td><span ex:content=".type"
> class="type"></span></td>
>                               <td><span ex:content=".subtype"
> class="subtype"></span></td>
>                               <td><span
> ex:content=".numParticipants"></span></td>
>
>                               <td><span ex:content=".date"></span></td>
>                               <td><span 
> ex:content=".participants"></span></td>
>                            </tr>
>                         </table>
>                      </div>
>                   </td>
> ====
>
> Any suggestions on either of these (though the first question is more
> important), appreciated.
It is possible to create a lens inside a tabular view, where you
specify what goes into the cells of a table row.  In this case, the
contents of the cell do not need to have any relation to the
ex:columns attribute.  So it sounds like in your case you want to
create a table where the ex:column contains 'date" but the cell
contains the "label".  Here's part of an example from one of my
exhibits; see the <table> tag inside the tabular view?  That's how you
create a lens.  This table displays a full name in column 1 but when
you click on column heading one it sorts by lastname.
 <div ex:role="view"
                   ex:viewClass="TabularView"
                   ex:label = "Table"
                   ex:columns =
".lastName, .grade, .pNames, .city, .phone, .fEm
ail"
                   ex:columnLabels="Name (sort by last), Grade,
                                    Address (sort by city), Phone,
Parents, Emai
l"
                   ex:sortColumn=0>
                <table style="display: none;">
                  <tr>
                    <td><span ex:content=".label"></span></td>
                    <td><span ex:content=".grade"></span></td>
>
> -James

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