Page 1 of 1

[VUE 2] Export is shifted 1 column with checkboxes

Posted: Tue Oct 12, 2021 5:18 pm
by jhk

Hi,

I'm using version 4.2.4.

I have a grid that uses the selectionMode feature with checkboxes. When I try to export my grid it appears that the checkbox column is also exported thus shifting the whole file (see attachment)

These are my relevant configurations:

  
{ excelExporterFeature: { exporterConfig: { // Choose the columns to include in the exported file // By not choosing any it will default to all. }, // pass the export library to exporter feature zipcelx, }, ...
selectionMode: { row: true, multiSelect: true, preserveSelectionOnDatasetChange: false, checkbox: true, showCheckAll: true, }, }

I have some 40 columns so I'd rather not type them out explicitly. Is there an easy fix :)?

Thanks


Re: [VUE 2] Export is shifted 1 column with checkboxes

Posted: Tue Oct 12, 2021 6:22 pm
by mats

Sure, you can configure the check column to not be exported. See checkbox docs for GridSelection#selectionMode

/**
             * The selection settings, where you can set these boolean flags to control what is selected. Options below:
             * @config {Object} selectionMode
             * @param {Boolean} selectionMode.row select rows
             * @param {Boolean} selectionMode.cell select cells
             * @param {Boolean} selectionMode.rowCheckboxSelection select rows only when clicking in the checkbox column
             * @param {Boolean} selectionMode.multiSelect Allow multiple selection
             * @param {Boolean|Object} selectionMode.checkbox Set to true to add a checkbox selection column to the grid,
             * or pass a config object for the {@link Grid.column.CheckColumn}
             * @param {Boolean} selectionMode.showCheckAll  true to add a checkbox to the selection column header to select/deselect all rows
             * @param {Boolean} selectionMode.deselectFilteredOutRecords true to deselect rows that are filtered out
             * @param {Boolean} selectionMode.includeChildren true to also select/deselect child nodes when a parent node is selected
             * @param {Boolean} selectionMode.preserveSelectionOnPageChange This flag controls whether the Grid should preserve
             * its selection when loading a new page of a paged data store
             * @param {Boolean} selectionMode.preserveSelectionOnDatasetChange This flag controls whether the Grid should preserve
             * its selection of cells / rows when loading a new dataset (assuming the selected records are included in
             * the newly loaded dataset)
             * @default
             * @category Selection
             */

And set its https://bryntum.com/docs/grid/api/Grid/column/CheckColumn#config-exportable value to false


Re: [VUE 2] Export is shifted 1 column with checkboxes

Posted: Tue Oct 12, 2021 7:00 pm
by jhk

Thanks for the quick reply!

I missed that in the docs. When I try to apply the changes it has no effect, but I do see it works in your demos.

The "hideable" property has no effect either so it leads me to think it's not reading my config object for the select.

Anything in my config that looks suspicious? (left out columns)

/* eslint-disable no-param-reassign */
import zipcelx from 'zipcelx';

import daLocale from '@/locales/da-DK';

import { oldValueRenderer, routeCellRenderer } from './cellRenderes';
import base from './base.config';

const PREFIX = 'taskList';

const getId = (col) => `${PREFIX}-${col}`;

export default (me, options) => ({
  ...base,

  excelExporterFeature: {
    exporterConfig: {
      // Choose the columns to include in the exported file
      // By not choosing any it will default to all.
    },

// pass the export library to exporter feature
zipcelx,
  },

  destroyStore: true,

  ref: PREFIX,

  id: PREFIX,

  selectionMode: {
    row: true,
    multiSelect: true,
    preserveSelectionOnDatasetChange: false,
    checkbox: {
      hideable: false,
      exportable: false,
      resiable: false,
    },
    showCheckAll: true,
  },

  columns: [
	.. left out
  ],

  searchFeature: false,

  cellMenuFeature: {
    items: {
      removeRow: {
        text: 'Slet',
        onItem: (evt) => me.onRemoveRow(evt),
      },
      copy: false,
      cut: false,
    },
  },

  listeners: {
    search: 'onSearchPerformed',
    finishCellEdit: 'onFinishCellEdit',
    selectionChange: 'onRowSelect',
    thisObj: me,
  },
});

Re: [VUE 2] Export is shifted 1 column with checkboxes

Posted: Tue Oct 12, 2021 10:17 pm
by mats

Oh yes - you'll need to upgrade to get this working, this 'checkbox' config option was added quite recently.


Re: [VUE 2] Export is shifted 1 column with checkboxes

Posted: Wed Oct 13, 2021 4:46 pm
by jhk

Yep that was it! Thanks :)