Cannot convert undefined or null to object

Hi,

I have noticed the error below when I open the view to add a new register. The Grid is being translated correctly, but in the view of adding a new record I have the error below.


Error when open add register dialog:

ej2.min.js:10 Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at t.getCultureValues (ej2.min.js:10)
    at t.createContentHeader (ej2.min.js:10)
    at t.createContent (ej2.min.js:10)
    at t.createContent (ej2.min.js:10)
    at t.render (ej2.min.js:10)
    at t.render (ej2.min.js:10)
    at t.disabledDates (ej2.min.js:10)
    at t.updateInput (ej2.min.js:10)
    at t.initialize (ej2.min.js:10)

componet inside Add_Partial_View register and does not work (not open dialog date) when add the script below

 <ejs-datetimepicker                       
                        cssClass="e-outline "
                        floatLabelType="Auto"
                        placeholder="Data Início"
                        id="DataInicio" name="DataInicio"
                        format="dd/MM/yyyy HH:mm:ss"
                        value="@Model.DataInicio.ToString("yyyy-MM-ddTHH:mm:ss")">
    </ejs-datetimepicker>
<ejs-scripts></ejs-scripts>

script inside Grid view

  function loadCultureFiles() {
        var ajax = new ej.base.Ajax(location.origin + '/../../scripts/src/pt-BR.json', 'GET', true);
        ajax.send().then((e) => {
            var culture = JSON.parse(e);
            ej.base.L10n.load(
                culture
            );
            ej.base.setCulture('pt-BR');
            ej.base.setCurrencyCode('EUR');
        });
    }

    document.addEventListener('DOMContentLoaded', function () {
        loadCultureFiles();
    });

3 Replies 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team May 14, 2021 09:20 AM UTC

Hi Roberto, 



Greetings from Syncfusion support. 


We validated the reported requirement. We could replicate the reported issue when loading the pt-BR culture in the application.  The cause for the reported issue is that you are trying use the culture which is not available in the CLDR data. Since the culture pt-BR is not available in the CLDR data definition, the stated issue arises. We suggest that you to use the available culture in the CLDR data to get rid of the reported issue. The below are the available “pt” culture in the CLDR data.  Kindly refer the below screenshot. 



 



Kindly get back to us for further assistance. 


Regards, 
Sevvandhi N 



RO Roberto May 14, 2021 11:54 PM UTC

Hi,

It is working. thanks

Marked as answer

SN Sevvandhi Nagulan Syncfusion Team May 17, 2021 07:44 AM UTC

Hi Roberto, 



We are glad to hear that the reported issue has been resolved. Please get back to us if you need further assistance. 



Regards, 
Sevvandhi N 


Loader.
Up arrow icon