David,
Thanks for the reply,
I have tried what you said but the following line is causing me problems:
var s = ... get the value of the parameter ...
I know I need to change it, but I don't know what to.
Phil.
David Huynh wrote:
> Hi Phil,
>
> There is no support for that at the moment, but you could add it
> yourself. Look for the function Exhibit.ListFacet.createFromDOM in
>
>
> http://static.simile.mit.edu/exhibit/api-2.0/scripts/ui/facets/list-facet.js
>
> You can add this code after including exhibit-api.js
>
> <script>
> Exhibit.ListFacet.createFromDOM = function(configElmt,
> containerElmt, uiContext) {
> ... copy the existing implementation here except for the last
> 3 lines ...
>
>
> var queryParamName = Exhibit.getAttribute(configElmt,
> "queryParamName");
> if (queryParamName != null && queryParamName.length > 0) {
> var s = ... get the value of the parameter ...
> facet._valueSet.add(s);
> }
>
> // the last 3 lines
> facet._initializeUI();
> uiContext.getCollection().addFacet(facet);
>
> return facet;
> }
> </script>
>
> David
>
>
> Phil Green wrote:
>
>> Hi,
>>
>> As a result of a previous post (Any way to set the value of a
>> TextSearchFacet through the DOM?)
>> <http://simile.mit.edu/mail/ReadMsg?listId=9&msgId=22604> the following code
>> was created
>>
>> <div ex:role="facet" ex:facetClass="TextSearch"
>> ex:queryParamName="srch"></div>
>>
>> so that the text search facet would take an initial value of "Brian" from
>> the url test.com/search.html?srch=Brian. What I would like to do is
>> similar, but instead of presetting the search box text, I would like to
>> pre-tick a selection in another facet. Something like:
>>
>> <div ex:role="facet" ex:expression=".Name" ex.facetLabel="Name"
>> id="Name-facet" ex:selection=srch></div>
>>
>> and if possible scroll the facet to show the item ticked.
>>
>> Does anyone know if this can be done?
>>
>> Regards,
>>
>> Phil.
>>
>>
>>
>>
>>
>> <http://simile.mit.edu/mailman/listinfo/general>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://simile.mit.edu/mailman/listinfo/general
>>
>>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general