Hi folks,
Is anyone aware of a way to turn on the facets by default when browsing using Smart View? I'm guessing there's a way to include an onRender event script, but can't seem to find any documentation for this.
Thank you,
Frank
I am afraid, that you would not want to build this as a Smart UI extension, if you want it to last for year or more withtou bugfixing.
Yes, you could force the facet panel shown in the "render" event handler by looking, how the "Filter" command handler does it. However, this not the public interface, which we try not to break in quarterly updates. For example, in CS 16.2.6 we stoped creating the facet panel at the beginning. It is created before it going to be shown first. You would have to go on changing your code, if some quarterly update broke it.
If you did the change to CS 16.0.x - private interface or not - it would be stable, because we do not develop 16.0 any more. Only bug fixes go there. But Smart UI customers should want to use the 16.2 product line, which is in active development.
You could file a feature request to make the shown/hidden state of the facet panel configurable. For example:
Administration of such flags in the database makes such features more expensive and the product more complicated. I would recommend option 1 and/or 2.
Thanks Ferdinand - I've raised a feature request for this. The tracking number is LPAD-69548.
Hi
Can you at least enable filter when you call the nodestable.view via script?
<script> csui.onReady(['csui/lib/jquery', 'csui/lib/marionette', 'csui/utils/contexts/browsing/browsing.context', 'csui/utils/contexts/factories/node', 'csui/widgets/nodestable/nodestable.view'], function ($, Marionette, BrowsingContext, NodeModelFactory, NodesTableView) {
'use strict'; var context = new BrowsingContext(), node = context.getModel(NodeModelFactory), tableView = new NodesTableView({ context: context, data: { containerId: [LL_REPTAG_!WID /] } }), tableRegion = new Marionette.Region({el: '#content2'}); tableRegion.show(tableView); context.fetch();
});</script>
Thanks
Uldis
Initialising the state of paging, sorting and filtering used to be possible:
var nodesTableView = new NodesTableView({ pageNumber: 2, orderBy: 'modify_date desc', filterBy: { name: 'test' }, context: browsingContext });
However, paging and sorting seems to have no effect in the most recent version. Presetting name filter works, but if you add a facet filter like this:
var nodesTableView = new NodesTableView({ filterBy: { name: 'test', facet: ['61033:0', '61032:1000'] }, context: browsingContext });
You will see the filter applied by the AJAX call and the name filter set in the UI, but the facet panel will not open.
Another problem will be obtaining the facet identifiers, which differ on different CS installations.
So, pre-setting a facet filter will not help this use case either.