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.
Unfortunately, activation email could not send to your email. Please try again.

Groupings not working for server side using UrlAdaptor

Thread ID:

Created:

Updated:

Platform:

Replies:

129883 Apr 7,2017 03:26 AM Apr 12,2017 12:14 AM JavaScript 3
loading
Tags: ejGrid
Mervin
Asked On April 7, 2017 03:26 AM

Hi I'm extending UrlAdaptor to process the result from my web service and the paging and sorting is working well but I'm getting error when using groupings.
grouping.PNG
please see attach code


Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 10, 2017 10:50 AM

Hi Mervin, 

Thanks for contacting Syncfusion support. 

We created a sample with the attached code example and we can reproduce the mentioned issue while grouping. In your code example we found that you return have the result and count in the processResponse method. By default, the grouping is done in client-side only. So, we need to process the grouping query and return the result and count. To achieve this, use the below code example.  

Find the code example and sample:  


<script type="text/javascript"> 
        var dataManager = ej.DataManager({ 
            url: "/Grid/DataSource", 
            adaptor: new ej.UrlAdaptor() 
        }); 
 
        var customAdaptor = new ej.UrlAdaptor().extend({ 
            processResponse: function (data, ds, query, xhr, request, changes) { 
                result = this.base.processResponse.apply(this, [data, ds, query, xhr, request, changes]); 
                return result; 
            }, 
        }); 
 
        $(function () {// Document is ready. 
            $("#Grid").ejGrid({ 
                dataSource: dataManager, 
                allowPaging: true, 
                --------------------------- 
               allowGrouping : true, 
                columns: [ 
                          --------------------------- 
               ], 
            }); 
        }); 
    </script> 


Regards, 
Prasanna Kumar N.S.V 
 


Mervin
Replied On April 11, 2017 01:11 AM

Hi Prasanna 

Awesome fix! thank you.

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 12, 2017 12:14 AM

Hi Mervin, 

We are happy to hear that your issue has been resolved. 

Please let us know if you need any further assistance. 

Regards, 
Prasanna Kumar N.S.V 


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.

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.

;