export class Default extends SampleBase {
state = { count: 0}
handleIncrement = () => {
this.setState({ count: this.state.count + 1})
}
handleDecrement = () => {
this.setState({ count: this.state.count - 1})
}
template1(data) {
return (
<TextBoxComponent placeholder="First Name" floatLabelType="Auto" value={data.text} />
);
}
headertext = [{ text: "Rome" }, { text: "Paris" }, { text: "London" }];
render() {
return (<div className='control-pane'>
<div className='control-section input-content-wrapper'>
<div className="row custom-margin custom-padding-5">
<TabComponent ref={(tab) => { this.tabObj = tab }} showCloseButton={true} heightAdjustMode='None' height={320}>
<TabItemsDirective>
<TabItemDirective header={this.headertext[0]}
content={{
template: this.template1,
data: { text: this.state.count }
}} />
</TabItemsDirective>
</TabComponent>
<div className="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<input type="text" id="text1" value={this.state.count} />
</div>
<button onClick={this.handleIncrement}>Increment by 1</button>
<button onClick={this.handleDecrement}>Decrement by 1</button>
</div>
</div>
</div>);
}
|