General Calendar Cards Color Date & Time Event Calendar Forms Grid Layout Image Listview Measurement Navigation Number Numpad Option List Page Popup Range Scroller Scrollview Select Timer Timespan Treelist Tools Accessibility

Mobiscroll Instance

When a mobiscroll component is initialized, an instance of the component is created. Through the instance you have access to all methods and properties of the component.

There are multiple ways to access the instance of an individual component.

1. Inside events

The mobiscroll instance is passed as parameter for every event of the component.

Sample usage
<mobiscroll.Date 
	onSet={function (event, inst){
		var selectedDate = inst.getVal(); // Call the getVal method
	}}
/>

2. Using the 'ref' attribute

The mobiscroll instance is available as the instance property in the mobiscroll react components. It can be reached after the componentDidMount fired, by setting a ref to the component.

showDate: function () {
	this.refs.date.instance.show();
},
render: function() {
    return (
        <div>
            <mobiscroll.Date ref="date"/>
		    <button onClick={this.showDate}>ShowDate<button>
        </div>
    );
}

3. Through active instance

Stores the currently active mobiscroll instance (expcept inline instances), or null if there is no active instance.

mobiscroll.activeInstance