# docx-editor-document-list

> Document list dialog opens named Word documents by author into the editor with a title bar.

**Framework:** angular  **Component:** DocxEditor  **Variant:** document-list

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/angular/docx-editor-document-list.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-angular-documenteditor @syncfusion/ej2-angular-popups
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/docx-editor-document-list/docx-editor.component.html

```html
<div class="control-section">
  <div id="Grid" class="table-responsive" style="height: calc(100vh - 180px);">
    <table class="table table-hover table-borderless align-middle">
      <thead>
        <tr>
          <th scope="col">File Name</th>
          <th scope="col">Author</th>
          <th scope="col" class="e-de-table-actions-header">Actions</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let row of data">
          <td>
            <svg style="vertical-align: sub; margin-right: 8px;" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M3 3C3 1.34315 4.34315 0 6 0H16.7574C17.553 0 18.3161 0.316071 18.8787 0.87868L26.1213 8.12132C26.6839 8.68393 27 9.44699 27 10.2426V27C27 28.6569 25.6569 30 24 30H6C4.34315 30 3 28.6569 3 27V3Z" fill="#4889EF"/>
              <path d="M17.5 11H25V10.5042C25 9.76949 24.7304 9.0603 24.2422 8.51114L19.9463 3.67818C18.9974 2.61074 17.6374 2 16.2092 2H16V9.5C16 10.3284 16.6716 11 17.5 11Z" fill="#D6E5FE"/>
              <path d="M10.3044 12H10.8868H11.104H11.6817L12.6231 16.3922L13.3963 12H15L13.5719 19H12.777H12.5552H11.8943L10.993 15.0093L10.1103 19H9.44945H9.22761H8.42808L7 12H8.60832L9.38188 16.3816L10.3044 12Z" fill="white"/>
              <rect x="7" y="21" width="16" height="2" rx="1" fill="white"/>
              <rect x="7" y="25" width="11" height="2" rx="1" fill="white"/>
            </svg>
            <span style="vertical-align: middle;">{{ row.FileName }}</span>
          </td>
          <td class="e-de-table-author-cell">{{ row.Author }}</td>
          <td class="e-de-table-actions-cell">
            <button type="button"
                    class="btn btn-sm btn-link text-secondary p-2 e-de-view-btn"
                    title="View"
                    (click)="onActionClick('View', row)">
              <i class="e-icons e-eye e-flat e-de-view-icon"></i>
            </button>
            <button type="button"
                    class="btn btn-sm btn-link text-secondary p-2 e-de-edit-btn"
                    title="Edit"
                    (click)="onActionClick('Edit', row)">
              <i class="e-icons e-edit e-flat e-de-edit-icon"></i>
            </button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

  <ejs-dialog id="component-dialog" #Dialog
        height="90%" width='90%' [enableResize]="true" [visible]="false" [position]="position" [isModal]="true" [zIndex]= "1500" (created)="onDialogCreate()">
        <ng-template #content>
            <div id="default_title_bar" class="e-de-ctn-title"></div>
            <div style="display:block; height: calc(100vh - 230px);">
                <ejs-documenteditorcontainer id="container" height="780px" #documenteditor_default [enableToolbar]="true" [locale]="culture" [zIndex]= "3000" [showPropertiesPane]="false" [serviceUrl]="hostUrl" (created)="onCreate()" (documentChange)="onDocumentChange()"  style="display:block;"></ejs-documenteditorcontainer>
            </div>
        </ng-template>
    </ejs-dialog>
</div>

<style>
@import '../style.css';
    .ej2-new {
        height: 590px;
    }
    #documenteditor_titlebar {
        border-bottom: 1px solid #2B3481;
        height: 36px;
        line-height: 26px;
        width: 100%;
        font-size: 12px;
        padding-left: 15px;
        padding-right: 10px;
        font-family: inherit;
    }

    #documenteditor_title_contentEditor {
        height: 26px;
        max-width: 85%;
        width: auto;
        overflow: hidden;
        display: inline-block;
        padding-left: 4px;
        padding-right: 4px;
        margin: 5px;
    }

    .single-line {
        cursor: text !important;
        outline: none;
    }

    .single-line:hover {
        border-color: #e4e4e4 !important;
    }

    [contenteditable="true"].single-line {
        white-space: nowrap;
        border-color: #e4e4e4 !important;
    }
    #Grid table {
      border: 1px solid #d7d7d7;
      table-layout: fixed;
      width: 100%;
    }
    
    #Grid table th,
    #Grid table td {
      border: 1px solid #d7d7d7;
      padding: 12px 8px;
      overflow: hidden;
      white-space: nowrap;
    }
    
    #Grid table th {
      width: 33.33%;
      font-weight: 600;
      text-align: left;
    }
    #Grid table th.e-de-table-actions-header {
      text-align: center;
    }
    #Grid table td {
      width: 33.33%;
    }
    #Grid table td.e-de-table-actions-cell {
      text-align: center;
    }
    #Grid table td.e-de-table-author-cell {
      padding-top: 20px;
    }
    
    #Grid table th:nth-child(1),
    #Grid table td:nth-child(1) {
      border-right: none;
    }
    #Grid table td:nth-child(1) {
      overflow: hidden;
      white-space: nowrap;
    }
    #Grid table th:nth-child(2),
    #Grid table td:nth-child(2) {
      border-left: none;
      border-right: none;
    }
    #Grid table th:nth-child(3),
    #Grid table td:nth-child(3) {
      border-left: none;
    }
    
    #Grid table tbody tr:hover {
      background-color: var(--de-row-hover, rgba(0, 0, 0, 0.04));
    }
    
    body.e-dark-mode #Grid table tbody tr:hover,
    body[class*='-dark'] #Grid table tbody tr:hover {
      background-color: var(--de-row-hover-dark, rgba(255, 255, 255, 0.07));
    }

    .e-de-view-btn,
    .e-de-edit-btn {
      background-color: transparent;
      border: 1px solid transparent;
      border-radius: 4px;
      padding: 4px 6px !important;
      margin: 0 4px;
      cursor: pointer;
      transition: all 0.3s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 28px;
      min-height: 28px;
      text-decoration: none;
      outline: none;
      box-sizing: border-box;
    }
    
    .e-de-view-btn:hover,
    .e-de-edit-btn:hover {
      background-color: #f5f5f5;
      border-color: #ccc;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
      text-decoration: none;
      outline: none;
    }
    .e-de-view-btn:focus,
    .e-de-edit-btn:focus {
      outline: none;
      text-decoration: none;
    }
    .e-de-view-btn:active,
    .e-de-edit-btn:active {
      background-color: #efefef;
      border-color: #999;
      outline: none;
    }
    
    .e-de-view-icon,
    .e-de-edit-icon {
      font-size: 16px;
      color: #7a8a99;
      display: inline-block;
      text-decoration: none;
      font-weight: 600;
      line-height: 1;
    }
    .e-de-view-btn:hover .e-de-view-icon,
    .e-de-edit-btn:hover .e-de-edit-icon {
      color: #5a6a7a;
    }
    .e-de-view-btn:active .e-de-view-icon,
    .e-de-edit-btn:active .e-de-edit-icon {
      color: #333;
    }
    
    .editor-in-dialog {
      min-height: 90% !important;
    }

    [class^="e-de-icon-"],
    [class*=" e-de-icon-"] {
        font-family: 'Sample brower icons' !important;
    }

    .e-de-icon-Print:before {
        content: "\e723";
    }

    .e-de-icon-Download:before {
        content: "\e728";
    }

    /** sample level font icons ends*/
</style>
```

### src/components/docx-editor-document-list/docx-editor.component.ts

```typescript
import { Component, ViewEncapsulation, ViewChild, OnInit } from '@angular/core';
import { ToolbarService, DocumentEditorContainerComponent,DocumentEditorContainerModule } from '@syncfusion/ej2-angular-documenteditor';
import { CommonModule } from '@angular/common';
import { DialogComponent,DialogModule  } from '@syncfusion/ej2-angular-popups';
import { TitleBar } from '../title-bar';
import { defaultDocument, characterFormat, paragraphFormat, styles, weblayout, WEB_API_ACTION } from '../datasource/docx-editor-data';
import { isNullOrUndefined } from '@syncfusion/ej2-base';

/**
 * Document Editor Component
 */
@Component({
    selector: 'control-content',
    templateUrl: 'docx-editor.component.html',
    encapsulation: ViewEncapsulation.None,
    providers: [ToolbarService],
    standalone: true,
    imports: [CommonModule, DocumentEditorContainerModule ,DialogModule ]
})
export class DocumentListComponent implements OnInit {
    public hostUrl: string = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
    @ViewChild('documenteditor_default')
    public container!: DocumentEditorContainerComponent;
    @ViewChild('Dialog')
    public dialog!: DialogComponent;
 
    public data: any = [];
    public culture: string = 'en-US';
    public position: any = { X: 'center', Y: 'center' };
    titleBar!: TitleBar;
    private mode: 'View' | 'Edit' = 'View';

    ngOnInit(): void {
        // ngOnInit function
        this.data = [{
            'FileName': 'Getting Started.docx',
            'Author': 'Ryan Hodson'
        },
        {
            'FileName': 'Character Formatting.docx',
            'Author': 'Elton Stoneman',
        },
        {
            'FileName': 'Paragraph Formatting.docx',
            'Author': 'Peter Shaw',
        },
        {
            'FileName': 'Styles.docx',
            'Author': 'Cody Lindley',
        },
        {
            'FileName': 'Web layout.docx',
            'Author': 'Scott Allen',
        }];
    }

    onDialogCreate(): void {
        let dialogElement: HTMLElement = document.getElementById('component-dialog')!;
    }

    onCreate(): void {
        let titleBarElement: HTMLElement = document.getElementById('default_title_bar')!;
        this.titleBar = new TitleBar(titleBarElement, this.container.documentEditor, true, false, this.dialog);
    }

    onDocumentChange(): void {
        if (!isNullOrUndefined(this.titleBar)) {
            this.titleBar.updateDocumentTitle();
        }
        this.container.documentEditor.focusIn();
    }

    public onActionClick(mode: 'View' | 'Edit', rowData: { FileName: string }): void {
        this.mode = mode;
        let currentDocument = rowData.FileName;
        this.container.documentEditor.documentName = currentDocument.replace(".docx", "");
        this.titleBar.updateDocumentTitle();
        switch (currentDocument) {
            case "Getting Started.docx":
            this.container.documentEditor.open(JSON.stringify((<any>defaultDocument))); break;
            case "Character Formatting.docx":
            this.container.documentEditor.open(JSON.stringify((<any>characterFormat))); break;
            case "Paragraph Formatting.docx":
            this.container.documentEditor.open(JSON.stringify((<any>paragraphFormat))); break;
            case "Styles.docx":
            this.container.documentEditor.open(JSON.stringify((<any>styles))); break;
            case "Web layout.docx":
            this.container.documentEditor.open(JSON.stringify((<any>weblayout))); break;
        }
        if(mode === 'View'){
            this.container.documentEditor.isReadOnly = true;
            this.container.documentEditor.enableContextMenu = false;
            this.container.showPropertiesPane = false;
            document.getElementById('documenteditor-share')!.style.display ='none';
            this.container.toolbarItems = ['Open', 'Separator', 'Find'];
        } else {
            this.container.documentEditor.isReadOnly = false;
            this.container.documentEditor.enableContextMenu = true;
            this.container.showPropertiesPane = true;
            this.container.documentEditorSettings.showRuler = true;
            document.getElementById('documenteditor-share')!.style.display ='block';
            this.container.toolbarItems = ['New', 'Open', 'Separator', 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields'];
        }
        this.dialog.show();
    }
}
```
