Our blazing fast Grid component built with pure JavaScript


Post by neetu@ciirus.com »

Hi,
I have downloaded your trial version of Grid and I am trying to integrate this in my .net core project so when I have given reference of grid.module.js like-

<script type="module" src="~/lib/bryntum/js/grid.module.js"></script

>
and in my js file I am using import like this-

import { Grid } from '/lib/bryntum/js/grid.module.js';

But its giving error- jquery.js:3850 Uncaught TypeError: Cannot destructure property 'nodeType' of 'c' as it is undefined.
at _DomHelper.getRootElement (grid.module.js:10:198521)
at Grid.beginGridMeasuring (grid.module.js:63:185080)
at Grid.measureRowHeight (grid.module.js:63:185622)
at Grid.changeRowManager (grid.module.js:63:159031)
at Grid.set (grid.module.js:10:29608)
at Grid.get (grid.module.js:10:30785)
at get rowManager (grid.module.js:63:128664)
at SubGrid.construct (grid.module.js:63:109748)
at new _Base (grid.module.js:10:34981)
at new b (grid.module.js:10:86825)

in line-

const grid = new Grid({
        appendTo: $(gridId),
        columns: [
            { field: 'name', text: 'Name' }
        ],
        data: [
            { name: 'Dan Stevenson' }
        ]
    });

So please tell solution for this how can I integrate Grid component in my .net core application using jQuery


Post by marcio »

Hey neetu,

Welcome to our forums! 🎉

Could you please try replacing $(gridId) with only the id of the div that you're looking for? Or $(gridId).get(0);.

So, if the gridId is container, you could use

const grid = new Grid({
        appendTo: 'container',
        columns: [
            { field: 'name', text: 'Name' }
        ],
        data: [
            { name: 'Dan Stevenson' }
        ]
    });

or

const grid = new Grid({
        appendTo: $('container').get(0),
        columns: [
            { field: 'name', text: 'Name' }
        ],
        data: [
            { name: 'Dan Stevenson' }
        ]
    });

Best regards,
Márcio


Post Reply