It looks like "type" is hard-coded. So, collections can only be based on the "type" field. It's in data/collection.js, line 177.
this._database.getSubjects(this._itemTypes[i], "type", newItems); However, it seems like it would be easy to define which field you want to base your collection on, such as adding an ex:itemName parameter, as in <div ex:role="exhibit-collection" ex:itemName="party" ex:itemTypes="Democratic"></div> This could probably also be extended with a little more work, to something like... <div ex:role="exhibit-collection" ex:itemName="party,religion" ex:itemTypes="Democratic,Episcopal"></div> <div ex:role="exhibit-collection" ex:itemName="party" ex:itemTypes="Democratic|Republican"></div> ..or many other possibilities. Has anyone tried this and run into any unexpected problems? The first option should be pretty easy. :-) - John ************************************************** John Callahan Geospatial Application Developer Delaware Geological Survey, University of Delaware 227 Academy St, Newark DE 19716-7501 Tel: (302) 831-3584 Email: [email protected] http://www.dgs.udel.edu ************************************************** John Callahan wrote: > Very cool! Thank you. I did not know about collections in exhibit. > (This may actually solve the problem of adding subsets of an Exhibit > feed to additional timeline bands.) > > The obvious question this brings up is... Can you create collections > using another item in the array except for 'type'? I'm looking at the > source code trying to figure it out. > > - John > ************************************************** > John Callahan > Geospatial Application Developer > Delaware Geological Survey, University of Delaware > 227 Academy St, Newark DE 19716-7501 > Tel: (302) 831-3584 > Email: [email protected] > http://www.dgs.udel.edu > ************************************************** > > > David Karger wrote: >> http://simile.mit.edu/wiki/Exhibit/2.0/Collections >> >> Rahul wrote: >> >>> How can I restrict a TableView so that it only displays data of a >>> certain type? I suspect I ought to use lenses but the tutorial is very >>> short on how to use them. >>> >>> I've one .js file with persons: >>> >>> { >>> "items" : [ >>> { >>> "label" : "Jsse Aafgnds", >>> "type" : "person", >>> "id" : "Jsse Aafgnds", >>> "countries" : ["Germany","Switzerland"] >>> }, >>> [snip] >>> } >>> ], >>> "properties" : { >>> "countries" : { >>> "valueType" : "item" >>> } >>> } >>> } >>> >>> and a second .js file with country info: >>> >>> { >>> "items":[ >>> {"id":"ad", >>> "label":"Andorra", >>> "type":"Flag", >>> "uri":"http://www.simile-widgets.org/exhibit/examples/flags/ >>> item#ad", >>> "modified":"no", >>> "code":"ad", >>> "latlng":"42.5,1.5", >>> "origin":"http://www.simile-widgets.org/exhibit/examples/flags/ >>> flags.html#ad" >>> }, >>> etc. >>> >>> >>> If I use a view: >>> >>> <div ex:role="view" >>> ex:viewClass="Exhibit.TabularView" >>> ex:label="Voulenteer List" >>> ex:columns=".label,.countries" >>> ex:columnLabels="Member,List of Countries" >>> </div> >>> >>> >>> then it insists on listing all the countries too. How can I only list >>> the "persons" and associated countries. There are a lot more countries >>> in the secon .js than there are persons. But I don't want all >>> countries to be listed. Only those for which there is a person. >>> >>> Basically list entries of type "person" only. >>> >>> Any ideas? >>> -- >>> Rahul >>> >>> >>> >> >> >> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
