Is it possible to change the cubegrid facets on the fly? I have seen a previous post on that matter with no response.
Depending on user actions, I want to change the facets (row facets) as well as the data. I even have problems with the latter one, but that’s a different thread.
The best would be if I could link it to a datasource, but even a set-via-array would do.
You can reveal facets via addFacet() and hide facets via setFixedFacetValue(). If you want to work with a totally unrelated set of facets, its best to create a new grid.
I consulted the reference but I’m still not sure how to use these. For eg. I can’t find anything that describes what fixedFacetValueId is, but it’s neccesary for setFixedFacetValue(). Can you link me to an example?
These APIs are used in the Analytics example on the website. The docs for the related method removeFacet may also help clarify usage.
Hi there,
We are using your analytic cube and we would like the users to be able to drag & drop facets to and from it. Its pretty much like the example you ship with the sdk (examples/analytics/databound_cubegrid.jsp). The difference is that we need to be able to remove facets from the cube again. In your example you don’t remove facets but you just give them a fixed value, like: cubeGrid.setFixedFacetValue(facetId,facetValue);
Is there any way to actually remove a facet from the cube once it was added?
The cube’s API offers the method: void removeFacet (facetId[, fixedFacetValueId])
but that doesn’t really help, because it only sets the facet to have a fixed value.
Regards,
Constantino
If you are viewing the same dataset before/after the facet was removed, then without switching the removed facet to a fixed value, you would have multiple records eligible for every cell.
I found a workaround for the problem. Instead of removing the facet I just remove the whole cube and re-create it again. Works just as well. The problem with removeFacet(facetId, valueId) is that it does not remove the facet as one might think, but it sets its fixed value.
Again, there’s nothing to work around here. If you were to remove a facet while retaining the same data model, you would have multiple records eligible for display in each cell, which doesn’t make sense.
If what you’re doing is, for example, moving from a dataset broken out by a facet to sums or averages over that whole facet, then make a facetValue called ‘sum’ or similar, and set this as the fixed value for the facet (just like the “sum” facetValue for the Regions facet in the Analytics sample).