Our blazing fast Grid component built with pure JavaScript


Post by syless »

Hi,

As you said, I tried to export in debug mode and got the messages.

Let me know if you need other information.

Thank you.

Attachments
log.log
(7.24 KiB) Downloaded 20 times

Post by Maxim Gorkovsky »

I haven't seen this error, export worked for me. Do you have any custom code related to export? Which version do you use?


Post by syless »

Hi,

I've tested the new code for exporting.

I used the Salesforce sample code.

Thank you.

Attachments
excelGrid.zip
(3.24 KiB) Downloaded 21 times
zipcelx.js
(523.79 KiB) Downloaded 23 times

Post by Maxim Gorkovsky »

I tried your LWC, it works for me with minor adjustment:

excelExporter: {
    zipcelx: window.zipcelx
}

and file gets exported. From the log it appears that some code (likely a column renderer) is trying to access style property of smth which does not exist. I checked our code and I don't see us reading style value, so I assume you've omitted some application code.


Post by syless »

Hi,

Sorry for the late reply.

But still I have an issue. Not sure what I missed.

Ver #1.

window.grid = new bryntum.grid.Grid({
            features: {
                rowReorder: true,
                search: true,
                excelExporter: {
                    //zipcelx
                    zipcelx: window.zipcelx
                },
            },
            appendTo: this.template.querySelector('.container'),
            store : {
                fields : [
                    { name : 'start', type : 'date' }
                ],
                data
            },
            columns
        });

And I got another error.
The zipcelx library is not recognized.

Can you share the js file to compare?

Thank you


Post by Maxim Gorkovsky »

What do you mean by not recognized? Does it say zipcelx is not a function or smth else?
I am attaching patched zipcelx library which I used. Make sure it is uploaded as a static resource.

Attachments
zipcelx.zip
(133.14 KiB) Downloaded 24 times

Post by kalashrastogi »

Hey @syless,

You may have forgotten to load the zipcelx library in the LWC JS file. Try loading it in renderedCallback() and see if that fixes the error. Please find the code below and the library attached.

      //import zipcelx after loading into static resource
      import zipcelx from "@salesforce/resourceUrl/zipcelx";
      ...
      //in renderedCallback()
      loadScript(this, zipcelx + "/zipcelx/zipcelx.js")
      ...
      //method to export data
      handleExport() {
        try {
          gantt.features.excelExporter.export({
          filename : this.projectRecord.Name
        });
      } catch (e) {
        console.log(e.stack);
        console.log(e)
      }

Let me know, if that works for you.
Thankyou

Attachments
zipcelx.zip
(133.14 KiB) Downloaded 24 times

Post Reply