# What's new in Gantt v4.2.3

## Configurable ExportDialog widget

In previous releases it was difficult to configure the export dialog widget. In the new release we applied the approach
used for the Task Editor which proved itself to be very flexible. You can customize widgets using the new 
[public](#Gantt/feature/export/PdfExport#config-exportDialog) config `exportDialog`:

```javascript
const gantt = new Gantt({
    features : {
        pdfExport : {
            exportDialog : {
                items : {
                    // hide the field
                    orientationField  : { hidden : true },

                    // move the field up
                    exporterTypeField : { weight : 150 },

                    // change default format in exporter
                    fileFormatField   : { value : 'png' },

                    // configure nested items
                    rangesContainer : {
                        layoutStyle : {
                            flexDirection : 'column'
                        },
                        items : {
                            rangeStartField : { value : new Date() }
                        }
                    }
                }
            }
        }
    }
});

gantt.features.pdfExport.showExportDialog();
```

You can add new fields, buttons, containers (any widget, essentially) and use their values in the export listeners. For
more info please refer to the updated [Export Dialog](#Scheduler/view/export/SchedulerExportDialog) documentation.

Also, export dialog has become [publicly available](#Gantt/feature/export/PdfExport#property-exportDialog) on the feature
instance, which allows adding listeners directly to it:

```javascript
const gantt = new Gantt({
    features : {
        pdfExport : true
    }
});

gantt.features.pdfExport.exportDialog.on({
    show() {
        const { columnsField } = this.widgetMap;
        // When dialog opens all columns with name matching 'date' would
        // be selected in the columns field 
        columnsField.value = gantt.columns.query(c => c.name.match(/date/i));
    }
})
```

Compared to previous releases export dialog is always there when you refer to it.


<p class="last-modified">Last modified on 2023-10-26 8:19:02</p>