Page 1 of 1

LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Tue Mar 14, 2023 2:08 pm
by amitjodhaff

An issue regarding editors and Firefox has been found with LWS enabled with Bryntum 5.2.10 version, where start cell editing event is not triggered and the handler is not called.

We could reproduce the issue with a new isolated grid component.

Steps to recreate: Start editing any cell and notice that handler isn't called.

We were not able to reproduce this error on any other browser, also, no relevant error seems to be reported in the developer console.


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Wed Mar 15, 2023 10:02 am
by alex.l

Hi,

What exactly event is not triggered for you?
I just tested with latest released version with this code in grid config

            listeners : {
                startCellEdit : () => {
                    console.log('cell edit');
                }
            },

and I see the event triggered in all browsers.

Please provide more information with code example what exactly is not working to you.

Thanks.


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Fri Mar 17, 2023 8:48 am
by amitjodhaff

Hi Alex, thanks for your reply.

I was wondering was this code run in a Salesforce LWC environment, where LWS was enabled on the org level?

The issue is replicatable only in that environemnt on Firefox browser as per my observation, same code that you have written can be used to verify.

I am asking because this is an LWS specific issue.

Best,
Amit


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Fri Mar 17, 2023 9:02 am
by alex.l

Hi Amit,

Yes sure, I used our Salesforce example for Grid component, re-built it from scratch and tested. I see it logged.
Here is a full code

/* globals bryntum : true */
import { LightningElement } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { loadScript, loadStyle } from 'lightning/platformResourceLoader';
import GRID from '@salesforce/resourceUrl/bryntum_grid';
import { columns, data } from './data';

export default class Grid_component extends LightningElement {
    renderedCallback() {
        if (this.bryntumInitialized) {
            return;
        }
        this.bryntumInitialized = true;

    Promise.all([
        loadScript(this, GRID + '/grid.lwc.module.js'),
        loadStyle(this, GRID + '/grid.stockholm.css'),
    ])
        .then(() => {
            this.createGrid();
        })
        .catch((error) => {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Error loading Bryntum Grid',
                    message: error,
                    variant: 'error',
                })
            );
        });
}

createGrid() {
    window.grid = new bryntum.grid.TreeGrid({
        features: {
            rowReorder: {
                dropOnLeaf: true
            },
            search: true,
        },
        appendTo: this.template.querySelector('.container'),
        store: {
            fields: [{ name: 'start', type: 'date' }],
            data,
            transformFlatData: true
        },
        listeners : {
            startCellEdit : () => {
                console.log('cell edit');
            }
        },
        columns,
    });
}
}


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Fri Mar 17, 2023 12:35 pm
by amitjodhaff

Hi Alex, thanks for continued prompt support and patience.

May I confirm that you are running the code with all three conditions matched?

  1. You are running on Salesforce Platform
  2. LWS (Lightning Web Security) is enabled on your org
  3. The browser is Firefox

By the looks of it, and I might be wrong, you are confirming from the standalone bryntum examples, which are independent of Salesforce platform, and the events are working fine in all cases except when all three above mentioned conditions are matched.

So, standalone examples will work fine in browser environment.

Thanks,
Amit


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Mon Mar 20, 2023 11:15 am
by amitjodhaff

Hi Alex, have you been able to reproduce in the salesforce environment?


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Mon Mar 20, 2023 11:58 am
by alex.l

Hi amitjodhaff,

LWS (Lightning Web Security) is enabled on your org

Officially we do not support LWS, we plan to introduce that later.
After I enabled LWS with version 5.3.1, I see another and more critical issues. I've opened ticket for those issues to fix it. When it will be fixed, we can return to this problem with event triggering and check if we can fix that moment before official LWS support release.

https://github.com/bryntum/support/issues/6405


Re: LWS Bryntum Grid Issue with start cell editing event in Firefox

Posted: Tue Mar 21, 2023 6:09 am
by amitjodhaff

Hi Alex,

Glad to know this information, I too have faced many issues with LWS enabled, this being a critical one for our ongoing work.

Thanks