How can to show the current selected cateogry on the left side of side bar

For the side bars while we are selecting in some cases the current selected category will be shown incase the current selected category is not shown means we can create an new object and display the current selected category.

_.extend(FacetsFacetedNavigationItemCategoryView.prototype, {

                    getContext: _.wrap(FacetsFacetedNavigationItemCategoryView.prototype.getContext, function(fn) {

                            var original = fn.apply(this, _.toArray(arguments).slice(1));

                            var newObj = {

                                "displayName": this.options.model.attributes.name,

                                "label": this.options.model.attributes.name,

                                "link": this.options.model.attributes.fullurl,

                                "isActive": true,

                                "additionalFields": {}

                            }

                            original.displayValues.push(newObj);

                       

                        return original

                    }),

                });

by the push method we can push the values in the new created object to show the current selected category.

Leave a comment

Your email address will not be published. Required fields are marked *