Hi Syncfusion Team,
I want to assign a custom function to the onClick event of the button generated by the FileManager item below in a Rich Text Editor. Is it possible?
private toolbarSettings: ToolbarSettingsModel = {
items: [ 'FileManager']
};Looking forward to your reply. Thank you.
|
export class Default extends React.PureComponent
{
constructor() {
super(...arguments);
this.items = [
{
template:
'<button class="e-tbar-btn e-btn e-filemanager-btn" tabindex="-1" id="fileManager_tbar" style="width:100%">File Manager</button>',
undo: true,
click: this.onClick.bind(this),
tooltipText: 'File Manager'
},
. . .
. . .
];
this.toolbarSettings = {
items: this.items
};
}
onClick() {
// here you can write your code
}
render() {
return (
< div >
< RichTextEditorComponent
id = "defaultRTE"
ref={scope => {
this.rteObj = scope;
}}
toolbarSettings ={ this.toolbarSettings}
>
< Inject services ={[HtmlEditor, Toolbar, Link, Image, QuickToolbar]} />
</ RichTextEditorComponent >
</ div >
);
}
}
render(< Default />, document.getElementById('sample')); |
Thank you. I will try it out.