Facetview sends invalid queries if called on an element not currently attached to the dom #12

Closed
tomoinn opened this Issue Jun 24, 2012 · 1 comment

Projects

None yet

2 participants

@tomoinn
Contributor
tomoinn commented Jun 24, 2012

I'm creating a BackBone view and calling $('#myelement',this.el).facetView() in the render() method. This is then called before adding the view's element to the DOM, the effect of which appears to be to cause facetview to send an invalid query :

{ query: { query_string: {} },
facets:
{ 'year.exact': { terms: [Object] },
'publisher.exact': { terms: [Object] } },
filter: { type: { value: 'structure' } } }

(the filter is being inserted by my code, but removing doesn't change the response). This fails to parse as there's no query in the query_string property, and the failure then causes facetview to fail on initialisation and not show the rest of the UI. It does show the search box, and subsequent searches from the part of the UI it has put up are well formed, it's just the initial one that fails.

@markmacgillivray
Member

Hmm. Not sure this one is worth fixing right now. Can be avoided by instantiating object in the DOM first. Possibly not always ideal, but given that I managed to miss this issue for nine months... apologies! Will close now, but if anyone has a requirement for this, then please re-open and we can look for a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment