Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141018 | Nov 19,2018 12:02 PM UTC | Nov 30,2018 12:47 PM UTC | Angular - EJ 2 | 5 |
![]() |
Tags: Grid |
@Component({
selector: 'app-root',
template: `
<ejs-richtexteditor #t id='defaultRTE' [(value)]='value'></ejs-richtexteditor>
<button (click)="h(t)">Assign</button>
<ejs-grid #grid [dataSource]='data' allowTextWrap='true'
[textWrapSettings]='wrapSettings' height='400'>
<e-columns>
<e-column field='Mainfieldsofinvention' headerText='Main fields of invention' width='150'></e-column>
</e-columns>
</ejs-grid>`,
providers: [ToolbarService, LinkService, ImageService, HtmlEditorService],
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
public data: Object[];
public wrapSettings: TextWrapSettingsModel;
public value = `
<p>The RichTextEditor triggers events based on its actions. </p>
<p> The events can be used as an extension point to perform custom operations.</p>
<ul>
<li>created - Triggers when the component is rendered.</li>
. . . . . .
</ul>`;
ngOnInit(): void {
this.data = [];
this.wrapSettings = { wrapMode: 'Content' };
}
h(t: HTMLTextAreaElement) {
this.data = [{ 'Mainfieldsofinvention': t.value }]; // you can save the text in grid cell.
}
} |
<ejs-grid [dataSource]='data'>
<e-columns>
<e-column field='XML' width='120' disableHtmlEncode="true"></e-column>
</e-columns>
</ejs-grid>
@Component({
selector: 'app-container',
.....
styles: [`
.e-grid.e-responsive .e-rowcell {
white-space: pre;
}
`]
})
export class AppComponent implements OnInit {. . . . }
|
public onCreate(args): void {
this.rteObj.focusIn();
this.rteObj.contentModule.getDocument().execCommand('insertText', true, this.content);
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.