How to gets information about all display options.

Description : Gets information about all display options, including the current display option. This method works only when the current view is the search page.

var plp = container.getComponent("PLP");
var allDisplayOptions = plp.getAllDisplay();
console.log(allDisplayOptions);

Example of the array of Display objects returned by this method:

[
 {
     columns: 1,
     icon: "icon-display-list",
     id: "list",
     isDefault: false,
     name: "List",
     template: "facets_item_cell_list.tpl"
 },
 {
     columns: 2,
     icon: "icon-display-table",
     id: "table",
     isDefault: false,
     name: "Table",
     template: "facets_item_cell_table.tpl"
 }
 {
     active: true,
     columns: 4,
     icon: "icon-display-grid",
     id: "grid",
     isDefault: true,
     name: "Grid",
     template: "facets_item_cell_grid.tpl"
 }
]

Leave a comment

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