File

src/ui/grid/dialogs/export-dialog/export-dialog.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Inputs

canExportAll
Type : boolean
Default value : false
columns
Type : ExportColumn[]
Default value : []
exportAll
Type : boolean
Default value : false
exportType
Type : "pdf" | "excel"
Default value : 'pdf'
fileName
Type : string
Default value : 'Export.pdf'
landscape
Type : boolean
Default value : false
paperSize
Type : "A4" | "Letter"
Default value : 'A4'

Methods

getResult
getResult()

Returns the result of the dialog.

Returns : ExportDialogResult

Properties

Public availableColumns
Type : ExportColumn[]
Default value : []
Public selectedColumns
Type : ExportColumn[]
Default value : []
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -                  *
* www.consultingwerk.com and other contributors as listed                *
* below. All Rights Reserved.                                            *
*                                                                        *
*  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY        *
*   KIND, either express or implied.                                     *
*                                                                        *
*  Contributors:                                                         *
*                                                                        *
**************************************************************************

--------------------------------------------------------------------------
    File        : export-dialog.component.html
    Purpose     : Template for export dialog.
    Author(s)   : Radu Nicoara
    Created     : Nov 21, 2025
--------------------------------------------------------------------------
-->
<div class="p-0">
  <div class="row mb-3">
    <div class="col-12">
      <label class="k-label mb-1 d-block">File Name</label>
      <kendo-textbox [(ngModel)]="fileName" class="w-100"></kendo-textbox>
    </div>
  </div>

  @if (exportType === 'pdf') {
    <div class="row mb-3">
      <div class="col-12">
          <label class="k-label mb-1 d-block">Paper Size</label>
          <div class="d-flex align-items-center">
              <input type="radio" name="paperSize" value="A4" kendoRadioButton [(ngModel)]="paperSize" id="ps-a4" />
              <label class="k-radio-label ms-2 me-4" for="ps-a4">A4</label>

              <input type="radio" name="paperSize" value="Letter" kendoRadioButton [(ngModel)]="paperSize" id="ps-letter" />
              <label class="k-radio-label ms-2" for="ps-letter">Letter</label>
          </div>
      </div>
    </div>

    <div class="row mb-3">
      <div class="col-12">
          <label class="k-label mb-1 d-block">Orientation</label>
          <div class="d-flex align-items-center">
              <input type="radio" name="orientation" [value]="false" kendoRadioButton [(ngModel)]="landscape" id="or-portrait" />
              <label class="k-radio-label ms-2 me-4" for="or-portrait">Portrait</label>

              <input type="radio" name="orientation" [value]="true" kendoRadioButton [(ngModel)]="landscape" id="or-landscape" />
              <label class="k-radio-label ms-2" for="or-landscape">Landscape</label>
          </div>
      </div>
    </div>
  }

  @if (canExportAll) {
    <div class="row mb-3">
      <div class="col-12">
        <label class="k-label mb-1 d-block">Records</label>
        <div class="d-flex align-items-center">
             <input type="radio" name="exportScope" [value]="false" kendoRadioButton [(ngModel)]="exportAll" id="es-current" />
            <label class="k-radio-label ms-2 me-4" for="es-current">Current Page</label>

            <input type="radio" name="exportScope" [value]="true" kendoRadioButton [(ngModel)]="exportAll" id="es-all" />
            <label class="k-radio-label ms-2" for="es-all">All Pages</label>
        </div>
      </div>
    </div>
  }

  <div class="row">
      <div class="col-12">
          <label class="k-label mb-1 d-block">Columns</label>
           <div class="d-flex w-100 gap-3 align-items-start">
                <div class="column-list-wrapper">
                    <span class="d-block mb-1 small text-muted">Available</span>
                    <div class="listbox-wrapper">
                        <kendo-listbox
                            #availableListBox
                            kendoListBoxDataBinding
                            kendoListBoxSelection
                            selectable="multiple"
                            [data]="availableColumns"
                            [connectedWith]="selectedListBox"
                            [toolbar]="false"
                            style="height: 100%; width: 100%">
                            <ng-template kendoListBoxItemTemplate let-dataItem>
                              <div class="w-100" (click)="availableListBox.performAction('transferTo')" class="listbox-item">
                                {{ dataItem.title || dataItem.field }}
                              </div>
                            </ng-template>
                            <kendo-listbox-messages
                                [noDataText]="'All available columns are selected.'"
                            ></kendo-listbox-messages>
                        </kendo-listbox>
                    </div>
                </div>

                <div class="toolbar-buttons d-flex flex-column gap-2">
                     <button kendoButton iconClass="fa-solid fa-angle-right" (click)="availableListBox.performAction('transferTo')" title="Select column"></button>
                     <button kendoButton iconClass="fa-solid fa-angle-left" (click)="selectedListBox.performAction('transferTo')" title="Unselect column"></button>
                     <button kendoButton iconClass="fa-solid fa-angles-right" (click)="availableListBox.performAction('transferAllTo')" title="Select all columns"></button>
                     <button kendoButton iconClass="fa-solid fa-angles-left" (click)="selectedListBox.performAction('transferAllTo')" title="Unselect all columns"></button>
                </div>

                <div class="column-list-wrapper">
                    <span class="d-block mb-1 small text-muted">Selected</span>
                    <div class="listbox-wrapper">
                        <kendo-listbox
                            #selectedListBox
                            kendoListBoxDataBinding
                            kendoListBoxSelection
                            selectable="multiple"
                            [data]="selectedColumns"
                            [toolbar]="false"
                            [connectedWith]="availableListBox"
                            style="height: 100%; width: 100%">
                            <ng-template kendoListBoxItemTemplate let-dataItem>
                                <div class="w-100" (click)="selectedListBox.performAction('transferTo')">
                                  {{ dataItem.title || dataItem.field }}
                                </div>
                            </ng-template>
                            <kendo-listbox-messages
                                [noDataText]="'No columns selected.'"
                            ></kendo-listbox-messages>
                        </kendo-listbox>
                    </div>
                </div>
           </div>
      </div>
  </div>
</div>

./export-dialog.component.scss

/**********************************************************************
 * Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -              *
 * www.consultingwerk.com and other contributors as listed            *
 * below. All Rights Reserved.                                        *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : export-dialog.component.scss
    Purpose     : Styles for export dialog.
    Author(s)   : Radu Nicoara
    Created     : Nov 21, 2025
  ----------------------------------------------------------------------*/

:host {
    display: block;
}

.k-label {
    font-weight: bold;
}

.column-list-wrapper {
    flex: 0 0 260px;
    min-width: 260px;
    ::ng-deep .k-list-item.k-selected {
        color: var(--kendo-color-primary) !important;
        background-color: rgba(from var(--kendo-color-primary) r g b / 0.1) !important;
    }
}

.toolbar-buttons {
    height: 250px;
    justify-content: center;
    align-self: center;

    ::ng-deep button.k-button-md.k-icon-button > span.k-button-icon.fa-solid {
        min-height: 0 !important;
        min-width: 0 !important;
    }
}

.listbox-wrapper {
    width: 100%;
    height: 250px;
    box-sizing: border-box;
    scrollbar-gutter: stable both-edges;

    ::ng-deep .k-listbox {
        width: 100%;
        height: 100%;
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""