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

Error in grid when refreshing

Hello,

When opening a page with a grid everything is alright. However, if I open a modal on the same page and then close it I get the following error - Cannot read property 'ej2_instances' of null. I think that has something to do with re-rendering the page because when I close the modal I call the this.StateHasChanged() method.


1 Reply

VN Vignesh Natarajan Syncfusion Team June 27, 2019 05:40 AM UTC

Hi Ivan,  

Thanks for contacting Syncfusion forums  

Query: “if I open a modal on the same page and then close it I get the following error - Cannot read property 'ej2_instances' of null. 

From your query, we understand that you are facing issue while closing the modal. Since it is a known issue we have fixed the reported issue in our 17.1.52-beta patch release and it requires .NETCore 3.0 Preview6. For your convenience we have prepared a sample with Grid and Dialog Modal using 17.1.53-beta (latest nuget) version.  We have closed and opened the dialog multiple times and we are not able to reproduce the issue.  

Kindly refer the below code example and sample for your reference 

<div class="col-lg-12 control-section" id="target"> 
    <Button id="normalbtn" class="e-btn" onclick="@onClicked">Open</Button> 
    <EjsDialog id="dialog" @ref="dialogObj" Created="@created" target="#target" header="Resize Me!!!" width="300px" allowDragging="true" enableResize="true" showCloseIcon="true" Content="<span>This is a dialog with resizable support.</span>"> 
    </EjsDialog> 
 
 
    <EjsGrid id="Grid" @ref="grid" AllowPaging="true" ActionComplete="@complete"> 
        <EjsDataManager Url="https://ej2services.syncfusion.com/production/web-services/api/Orders" Adaptor="Adaptors.WebApiAdaptor"></EjsDataManager> 
        <GridColumns> 
            <GridColumn Field="OrderID" HeaderText="Employee ID" ISPrimaryKey="true" TextAlign="@Syncfusion.EJ2.RazorComponents.Grids.TextAlign.Right" Width="90"></GridColumn> 
            <GridColumn Field="CustomerID" HeaderText="First Name" Width="90"></GridColumn> 
            <GridColumn Field="EmployeeID" HeaderText="Employee ID" Width="90"></GridColumn> 
            <GridColumn Field="Freight" HeaderText="Freight" Width="90"></GridColumn> 
        </GridColumns> 
    </EjsGrid> 
</div> 


After referring to sample, if you are still facing the issue, kindly share the following details  

  1. Share the Grid rendering code and Modal details.
  2. Share the screenshot of script error with stack trace.
  3. Share your nuget version for Syncfusion Razor components.
  4. Also ensure you are using .NETCore 3.0 Preview 6.

The requested details will be helpful for us to validated the reported issue at our end and provide solution as early as possible  

Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon