new SearchPageSelectorView()
- Source:
Extends
- Backbone.View
Members
events
list of events for Backbone View
Methods
(static) init()
For each page selector on a page creates instance of
"SearchPageSelectorModel" and
"SearchPageSelectorView"
createFirstPageUrlHash(data) → {String}
Calculates hash parameters for first page
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data that contains component properties |
Returns:
hash parameter for first page
- Type
- String
handleButtonState(selectedPage, pageCount)
Sets up page selectors buttons state depending on selected values
Parameters:
Name | Type | Description |
---|---|---|
selectedPage |
Number | number of selected page |
pageCount |
Number | number of pages |
handleLoadedData(data)
Updates hash and model based on data object
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data that contains component properties |
initialize()
- Source:
Initially sets data to model and watches events on which
view should be updated
Listens to Events:
- module:searchPageSelector.SearchPageSelectorView~event:change
- module:XA.component.search.vent~event:results-loaded
render()
Renders view
showFirstPage(event)
Switches page selector to the first page and updates hash parameters
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Event object that contains target with selected component value |
showLastPage(event)
Switches page selector to the last page and updates hash parameters
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Event object that contains target with selected component value |
showNextPage(event)
Switches page selector to the next page and updates hash parameters
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Event object that contains target with selected component value |
showPrevPage(event)
Switches page selector to the precious page and updates hash parameters
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Event object that contains target with selected component value |
updateElementCssClass(data)
Function that based on selected component values sets css class
page-selector-empty or page-selector-single-page
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data that contains component properties |
updateModelAfterSearch(data, selectedValue)
Updates model values with selectedValue
and data object from server response
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | Data that contains component properties |
selectedValue |
Number | number of selected page |
updateSelectedValue(event)
Updates hash according to changed component value
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | Event object that contains target with selected component value |