Usage
Signature:
interface RefresherElement
- Typescript Import Format
- //To typecheck the element APIs, import as below.
 import { RefresherElement } from "ojs/ojrefresher";
 //For the transpiled javascript to load the element's module, import as below
 import "ojs/ojrefresher";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Styling Classes
- 
        .oj-scroller
- 
      
        Designates the element to be the scroller element used in place of the target.Example<oj-refresher id='myrefresher' threshold='100' text='Checking for updates' refresh-content='[[refreshFunc]]'> <oj-list-view id="refreshId"></oj-list-view> </oj-refresher>
- 
        CSS Variables
| Name | Type | Description | 
|---|---|---|
| --oj-refresher-bg-color | <color> | Refresher background color | 
Attributes
- 
    
    refresh-content :function(): Promise.<*>
- 
    
      The function to invoke when the pull to refresh is triggered. Must return a Promise which will be resolved when the refresh function is completed. - Default Value:
- null
 
 NamesItem Name Property refreshContentProperty change event refreshContentChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-refresh-content-changed
- 
    
    target :Element
- 
    
      The target to detect pull down. If no target is specified, then the wrapper will attempt to use the first child element with the 'oj-scroller' CSS style class applied to it. If no such element is found, then the first child element of the oj-refresher element will be used. - Default Value:
- null
 
 NamesItem Name Property targetProperty change event targetChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-target-changed
- 
    
    text :string
- 
    
      A text messsage shown in the pull-to-refresh panel after a pull down gesture. - Default Value:
- ''
 
 NamesItem Name Property textProperty change event textChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-text-changed
- 
    
    threshold :number
- 
    
      The minimum distance in pixels that the user needs to pull down in order to trigger a refresh. If 0, then the threshold will default to the height of the target element. - Default Value:
- 0
 
 NamesItem Name Property thresholdProperty change event thresholdChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-threshold-changed
- 
    
    translations :object|null
- 
    
      A collection of translated resources from the translation bundle, or nullif this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.If the component does not contain any translatable resource, the default value of this attribute will be null. If not, an object containing all resources relevant to the component.If this component has translations, their documentation immediately follows this doc entry. NamesItem Name Property translationsProperty change event translationsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changed
- 
    
    (nullable) translations.aria-refresh-complete-link :string
- 
    
      Label assigned to the refresh message to denote refresh complete that appears after triggering refresh content. - Default Value:
- "Refresh complete"
 
- Since:
- 5.1.0
 
 NamesItem Name Property translations.ariaRefreshCompleteLink
- 
    
    (nullable) translations.aria-refresh-link :string
- 
    
      Label assigned to the refresh link used for triggering refresh content when using keyboard or accessibility agents such as VoiceOver. - Default Value:
- "Activate link to refresh content"
 
- Since:
- 5.1.0
 
 NamesItem Name Property translations.ariaRefreshLink
- 
    
    (nullable) translations.aria-refreshing-link :string
- 
    
      Label assigned to the refresh message to denote that the refresh is occurring that appears after triggering refresh content. - Default Value:
- "Refreshing content"
 
- Since:
- 5.1.0
 
 NamesItem Name Property translations.ariaRefreshingLink
Methods
- 
        
    
    
      getProperty(property) : {any}
- 
    
    
    Retrieves the value of a property or a subproperty. The return type will be the same as the type of the property as specified in this API document. If the method is invoked with an incorrect property/subproperty name, it returns undefined.Parameters:Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
 
 Returns:- Type
- any
 ExampleGet a single subproperty of a complex property: let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');
- 
        
    
    
      refresh : {void}
- 
    
    
    Refreshes the component.Returns:- Type
- void
 
- 
        
    
    
      setProperties(properties) : {void}
- 
    
    
    Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.Parameters:Name Type Description propertiesObject An object containing the property and value pairs to set. - Since:
- 4.0.0
 
 Returns:- Type
- void
 ExampleSet a batch of properties: myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"});
- 
        
    
    
      setProperty(property, value) : {void}
- 
    
    
    Sets a property or a subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.Parameters:Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. - Since:
- 4.0.0
 
 Returns:- Type
- void
 ExampleSet a single subproperty of a complex property: myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");