When button is clicked a blank page opens in a new tab. I would like to be able to click and get new tab to open with to different sites that are shown.
I discovered that having the link like below works:
btnClick() {
window.open("https://www.google.com");
}
....................
<ButtonComponent cssClass='e-link' onClick={this.btnClick.bind(this)}>Go to google</ButtonComponent>
import { enableRipple } from '@syncfusion/ej2-base';
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';
enableRipple(true);
class App extends React.Component {
// Click Event.
btnClick() {
window.open();
}
render() {
return (<div>
<ButtonComponent cssClass='e-link' onClick={this.btnClick.bind("https://www.google.com")}>Go to google</ButtonComponent>
</div>);
(<div>
<ButtonComponent cssClass='e-link' onClick={this.btnClick.bind("https://www.yahoo.com")}>Go to yahoo</ButtonComponent>
</div>);
}
}
ReactDom.render(<App />, document.getElementById('button'));
no errors, just does not link to expected websites.