Author Topic: Error with grid Export  (Read 398 times)

Aleutian

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 4
    • View Profile
Error with grid Export
« on: April 04, 2023, 08:27:45 pm »
pqgrid 8.2.1
I receive the following error when I attempt to export the grid in excel format. No issue with other formats. I have tried specifying a hex color, but the same error occurs.
pqgrid.min.js:17 Uncaught invalid color: rgb(72, 135, 199)
(anonymous) @ pqgrid.min.js:17
getStyle @ pqgrid.min.js:17
exportWb @ pqgrid.min.js:17
Export @ pqgrid.min.js:17
n.exportData @ pqgrid.min.js:17
listener @ cstar.rf.js:210
(anonymous) @ pqgrid.min.js:13
dispatch @ 3.6.0.min.js:2
v.handle @ 3.6.0.min.js:2

    if (typeof rfc.export === "boolean" && rfc.export) {
        if (!obj.toolbar) obj.toolbar = { items: [] };
        obj.toolbar.items.push({
                    type: 'select',
                    label: 'Format: ',               
                    attr: 'id="export_format"',
                    options: [{ csv: 'Csv', htm: 'Html', xlsx: 'Excel', json: 'Json'}]
                });
        obj.toolbar.items.push({
            type: 'button', label: "Export ", icon: 'ui-icon-arrowthickstop-1-s',
            listener: function () {
                    format = $("#export_format").val(),
//                    color = "#99CC99"                           
                    blob = this.exportData({ format: format, sheetName: rfc.title || rfc.list, render: true }),
                    name = (rfc.exportName ? rfc.exportName : (rfc.title || rfc.list) + "." + format);
                if (typeof blob === "string") blob = new Blob([blob]);
                saveAs(blob, name);
            }
        });
        obj.toolbar.items.push({ type: 'separator' });
    }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Error with grid Export
« Reply #1 on: April 04, 2023, 08:52:53 pm »
Please check whether you have assigned "rgb(72, 135, 199)" either in your code or data.

Or kindly share a jsfiddle with reproducible issue so that I can check it.
« Last Edit: April 04, 2023, 08:55:20 pm by paramvir »

Aleutian

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Error with grid Export
« Reply #2 on: April 05, 2023, 12:35:03 am »
That was it. I appreciate the assist. The color was assigned to link fields.