|
export const ToolbarItemTemplte = props => {
return (<div className="e-tbar-btn" title={props.text}> <span className={props.prefixIcon} /> </div>);
};
export class Default extends SampleBase {
constructor() {
super(...arguments);
this.toolbarItems = [
{ text: "Cut", prefixIcon: "e-cut-icon tb-icons e-icons", align: "Left" },
{ text: "Copy", prefixIcon: "e-copy-icon tb-icons e-icons", align: "Left" },
{ text: "Paste", prefixIcon: "e-paste-icon tb-icons e-icons", align: "Left" },
{ text: "Underline", prefixIcon: "e-underline-icon tb-icons e-icons", align: "Right" },
{ text: "Italic", prefixIcon: "e-italic-icon tb-icons e-icons", align: "Right" },
{ text: "Bullets", prefixIcon: "e-bullets-icon tb-icons e-icons", align: "Right" }
];
}
render() {
return (
<ToolbarComponent>
<ItemsDirective>
{this.toolbarItems.map(function (item, i) {
return (<ItemDirective align={item.align} template={ToolbarItemTemplte.bind(this, item)} key={i}/>);
})}
</ItemsDirective>
</ToolbarComponent>
);
}
}
render(<Default />, document.getElementById("sample")); |