Uncaught ReferenceError: {key} is not defined

0 Answers 345 Views
Grid
walter
Top achievements
Rank 1
walter asked on 16 Jun 2023, 03:43 AM | edited on 16 Jun 2023, 03:45 AM

I don't know what is the cause of the error. Maybe someone might have a solution with my issue.

Here is my sample data

Here is my code

function mapDataSource2(model, records) {
        let dataSource = new kendo.data.DataSource({
            transport: {
                read: function (options) {
                    options.success(records); <------ IF I REMOVE THIS, THE ERROR WILL NOT SHOW
                },
                parameterMap: function (options, operation) {
                    if (operation !== "read" && options.models) {
                        return { models: kendo.stringify(options.models) };
                    }
                }
            },
            autoSync: true,
            schema: {
                model: model,
                total: function (data) {
                    return $(data).length;
                }
            },
            pageSize: 50
        });

        return dataSource;
    }

 

thanks in advance

walter
Top achievements
Rank 1
commented on 16 Jun 2023, 03:44 AM

if you need more details please inform me. Thanks
Neli
Telerik team
commented on 20 Jun 2023, 11:01 AM

Hi Walter,

I used the provided snippet to test locally with dummy data, but I did not manage to replicate the issue. Coud you please take a look at the Dojo linked here and let me know if I am missing something?

You can also try to replace the data returned on your side in the records array in the Dojo and test if the Grid will be loaded as expected.

Regards,

Neli

No answers yet. Maybe you can help?

Tags
Grid
Asked by
walter
Top achievements
Rank 1
Share this question
or