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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

childGrid makes another call to the controller.

Thread ID:

Created:

Updated:

Platform:

Replies:

146376 Aug 1,2019 08:56 PM UTC Aug 2,2019 01:20 PM UTC ASP.NET Core - EJ 2 3
loading
Tags: DataGrid
pk
Asked On August 1, 2019 08:56 PM UTC

Hi, 
I have a problem with a child grid, that is added to the main one on the loadGrid event:

the main grid:

<ejs-grid id="my-grid" dataBound="dataBound" load="loadChild" [...]
      <e-data-manager url="@Url.Action("UrlDataSource")" adaptor="UrlAdaptor"></e-data-manager>
     [...]

and the child has it's own urlAdaptor.

    function loadChild() {
        this.childGrid = {
            dataSource: new ej.data.DataManager({
                url: "@Url.Action("UrlChildDataSource")",
                adaptor: new ej.data.UrlAdaptor(),
                crossDomain: true
            }),
            queryString: 'rowguid',
            allowPaging: true,
            allowSorting: true,
            dataBound: function () {
                this.autoFitColumns();
            },
            pageSettings: {pageSize: 5},
            columns: [
                { field: 'displayName', headerText: 'Display Name', width: 200 },
                [.......]
            ],
        };
    }

I'm getting 2 calls when the page/grid loads to the main grid controller... if I comment that event (and omit the child grid) I get only one call.
As you see, the adaptors are diferent endpoints.
Any Idea of what I am doing wrong?

thanks.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On August 2, 2019 09:29 AM UTC

Hi Pablo,  

Thanks for contacting Syncfusion Support.  

We can reproduce the reported problem at our end. All properties in the Grid will trigger an onPropertyChange method. Based on the properties, Grid will be refreshed. In your cases, since the childGrid has been assigned, the entire content has been re-rendered followed by refreshing them. To avoid this problem, we suggest to use the setProperties method with the second (mute on change) parameter as true. Refer to the following code example.  

<div class="control-section"> 
    <ejs-grid id="HierarchyPrint" load="onLoad"> 
        <e-data-manager url="@Url.Action("UrlChildDataSource")" adaptor="UrlAdaptor"></e-data-manager> 
           . . . 
             . . . 
    </ejs-grid> 
</div> 
 
<script> 
    function onLoad(args) { 
        this.setProperties({ 
            childGrid: { 
                dataSource: new ej.data.DataManager({ 
                    url: "@Url.Action("UrlDataSource")", 
                    adaptor: new ej.data.UrlAdaptor() 
                }), 
                queryString: 'EmployeeID', 
          . . .  
                 . . . 
            } 
        }, true); 
    } 
</script> 

Regards,  
Seeni Sakthi Kumar S. 


pk
Replied On August 2, 2019 01:14 PM UTC

Thank you very much. Solved.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On August 2, 2019 01:20 PM UTC

Hi Pablo,  

Greetings from Syncfusion. 

We are happy to hear that your requirement has been achieved and you are good to go. 

Please get back to us, if you require further assistance on this.  

Regards,  
Seeni Sakthi Kumar S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon