We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using grid template breaks the application, Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Hi,

I'm using data grid component, using template in ColumnDirective breaks the application. Here are the steps to reproduce issue,

  • Export data to excel or CSV
  • Click any links (context menu items, or navigating to another page) breaks the app.

Package versions,

"@syncfusion/ej2-base": "^20.3.56",
"@syncfusion/ej2-react-charts": "^20.3.58",
"@syncfusion/ej2-react-grids": "^20.3.56",
"@syncfusion/ej2-react-navigations": "^20.3.56",


My component,

<GridComponent
ref={(grid) => (gridRef.current = grid)}
dataSource={data}
dataStateChange={dataStateChange}
allowPaging={true}
allowSorting={true}
allowMultiSorting={false}
allowTextWrap={true}
showColumnMenu={true}
columnMenuItems={["AutoFitAll", "AutoFit", "SortAscending", "SortDescending"]}
style={{ isolation: "isolate" }}
pageSettings={{
pageSize: take,
pageCount: 3,
pageSizes: ["5", "10", "15", "20", "50", "100", "200"],
}}
allowExcelExport={true}
queryCellInfo={queryCellInfoEvent}
excelExportComplete={excelExportComplete}
contextMenuItems={[
{
text: "Export",
items: [
{ id: "csvExport", text: "CSV Export", iconCss: "e-svg-file-delimited-outline" },
{ id: "excelExport", text: "Excel Export", iconCss: "e-svg-microsoft-excel" },
],
},
]}
contextMenuClick={contextMenuClick}
commandClick={commandClick}
loadingIndicator={{ indicatorType: "Shimmer" }}
>
<Inject
services={[Page, ExcelExport, Resize, Sort, ColumnMenu, CommandColumn, ContextMenu]}
/>
<ColumnsDirective>
<ColumnDirective field="field1" headerText="field1" width={250} />
<ColumnDirective
field="field2"
headerText="field2"
disableHtmlEncode={false}
template={template}
/>
<ColumnDirective
field="field3"
headerText="field3"
textAlign="Right"
width={180}
/>
ColumnsDirective>
GridComponent>


I'm also sharing dataStateChange and excelExportComplete methods just in case,

function dataStateChange(state: DataStateChangeEventArgs) {
if (state.action?.requestType === "paging") {
setGridDataState({ take: Number(state.take), skip: Number(state.skip) });
}
if (state.action?.requestType === "sorting") {
const name = state.sorted?.[0].name;
const direction = state.sorted?.[0].direction;
setGridDataState({
sortBy: name as SortByCustomReport,
sortOrder:
direction === "ascending" ? "asc" : direction === "descending" ? "desc" : undefined,
});
}
}

function excelExportComplete() {
if (gridRef.current && data) {
gridRef.current.dataSource = data;
gridRef.current.hideSpinner();
}
}


My template,

const template = (data: any) => {
return data.field2.split(",").map((label, index) => (
<Tag size="sm" key={index} variant="solid" colorScheme="teal">
{label}
Tag>
));
};


The error message:

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.



I'm looking forward to hearing from you, thanks!


3 Replies 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team January 25, 2023 03:15 PM UTC

Hi Can,

Thanks for Syncfusion support.


Kindly update all the Syncfusion packages to the latest version (^20.4.38) version and check the reported problem.


Steps to update the packages:

  • Delete the package.lock.json file from your application.
  • Remove the @syncfusion folder from your project.
  • Use the current version (^20.4.38 or use *) for all the Syncfusion components in the package.json file.
  • Then execute npm install command.


UG: https://ej2.syncfusion.com/react/documentation/common/how-to/update-npm-package/


Also, use npm dedupe to remove duplicate packages.


Still, if you face any issues, Kindly share the below details to validate it further.

  1. The complete Grid code files and package.json file.
  2. A video demonstration of the issue you are experiencing, as this will allow us to see the issue in action.
  3. If possible, a reproducible sample of the issue would be greatly appreciated, as it would help us resolve it more efficiently.


Regards,
Rajapandiyan S


Marked as answer

CA Can January 26, 2023 12:27 PM UTC

Thanks for your response,


Upgrading the package versions solved my problem, somehow I got this message at the top of my page; "The included Syncfusion license key is invalid." Do I need to generate a new license key for a specific version?



RS Rajapandiyan Settu Syncfusion Team January 27, 2023 04:35 AM UTC

Hi Can,

We are glad to hear that you have resolved the reported problem.


Query: I got this message at the top of my page; "The included Syncfusion license key is invalid." Do I need to generate a new license key for a specific version?

Can you ensure you have generated license key and registered.

https://ej2.syncfusion.com/react/documentation/licensing/license-key-generation/

https://ej2.syncfusion.com/react/documentation/licensing/license-key-registration/


Syncfusion License keys are version specific, if you have upgraded from one major version to other, Please ensure the generate keys for specific version you are using and register keys.


If you are still facing issues after registering keys, please share more details about the framework and components you are using.


Regards,
Rajapandiyan S


Loader.
Live Chat Icon For mobile
Up arrow icon