This component is a dropdown selector for categories.
There are two ways to use it:
Create the component like this:
var categoriesDropdown = sdk.component('categoriesDropdown', target:String, options:Object);
By default, this component looks like this:
This is the HTML component. For example, the "#inbenta" target is:
<div id="inbenta"></div>
Available options to set in this component
Name | Type | Default | Description |
---|---|---|---|
selectedCategory | integer | 0 | Active category |
baseCategory | integer | 0 | Starting point of the category tree |
Default options object
{
selectedCategory: 0,
baseCategory: 0
}
The following methods can be used in this component:
Name | Description |
---|---|
setSelectedCategory(category: integer) |
Set the active category |
setBaseCategory(category: integer) |
Set the base category |
This component does not have any subcomponents.
Events to listen on this component:
Name | Event data | Description |
---|---|---|
categoryId | integer | Active category |
This component does not track any data.
Labels of this component. The default labels of each component can be rewritten in the SDK creation configuration.
Name | Default | Description |
---|---|---|
CATEGORIES_DROPDOWN_TITLE | Categories |
HTML for categories sidebar title |
CATEGORIES_DROPDOWN_PLACEHOLDER | Choose category |
HTML for categories dropdown placeholder |
Create sidebar and categories components and link them.
var categoriesDropdown = sdk.component('categoriesDropdown', '#sidebar');
var categories = sdk.component('categories', '#categories');
categories.linkToCategoriesDropdown(categoriesDropdown);