ghiscoding / slickgrid-universal

Slickgrid-Universal is a monorepo which includes all Editors, Filters, Extensions, Services related to SlickGrid usage and is also Framework Agnostic
https://ghiscoding.github.io/slickgrid-universal/
Other
90 stars 29 forks source link

Add preventDocumentFragmentUsage condition to checkboxSelectorColumn #1614

Closed good-ghost closed 4 months ago

good-ghost commented 4 months ago

In the Salesforce environment, DocumentFragment is not supported. So add condition to createElement for checkboxSelectorColumn.

stackblitz[bot] commented 4 months ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

good-ghost commented 4 months ago

I missed some part of code editing.. Sorry make inconvenience.

ghiscoding commented 4 months ago

@good-ghost your PR seems ok (without testing it), you were just missing HTMLSpanElement on the checkboxSelectionFormatter function on line 351 (or around there)

- protected checkboxSelectionFormatter(row: number, _cell: number, _val: any, _columnDef: Column, dataContext: any, grid: SlickGrid): DocumentFragment | null {
+ protected checkboxSelectionFormatter(row: number, _cell: number, _val: any, _columnDef: Column, dataContext: any, grid: SlickGrid): DocumentFragment | HTMLSpanElement | null {
    if (dataContext && this.checkSelectableOverride(row, dataContext, grid)) {
      const UID = this.createUID() + row;
      return this.createCheckboxElement(`selector${UID}`, !!this._selectedRowsLookup[row]);
    }
    return null;
}

you were right, it looks like I missed that Document Fragment, so making this change makes sense