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.
Syncfusion Feedback

Grid hangs when using custom adapter even though for testing I set a manual value in proccessResponse

Thread ID:

Created:

Updated:

Platform:

Replies:

132461 Sep 3,2017 09:29 PM UTC Sep 6,2017 01:48 PM UTC JavaScript 1
loading
Tags: ejGrid
dan
Asked On September 3, 2017 09:49 PM UTC

Is processResponse the last step before binding data to the grid.  Currently the grid just hangs with a spinning circle.

I am setting the results manually in processResponse to 
let results =  { result: [], count: 0 }
but it still hangs.  Normally I pass in a array on object for the value of result.  But the empty array should just result in empty results not a hang with spinning circle

Attached is my adapter if you could possibly take a look at it.

Thank you.

The attachment is the adapter.

Attachment: syncfusionfeathersadapter_4196a6b2.7z

The below is the grid being bound

let customers = await  this.api.customers.find();
let dataManager = new ej.DataManager(customers);
dataManager.adaptor = new this.adapter.feathersAdapter();


$("#Grid").ejGrid({
dataSource: dataManager,
toolbarSettings: {
showToolbar: true,
toolbarItems: ["add", "edit", "delete"]
},
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
editMode: "dialog"
},
allowPaging: true,
allowSorting: true,
allowFiltering: true,
filterSettings: {showPredicate: true, filterType: "menu", enableCaseSensitivity: true},
searchSettings: {ignoreCase: false},
isResponsive: true,
columns: [
{"field": "first_name"},
{"field": "last_name"},
{"field": "company"},
{"field": "id", "isPrimaryKey": true}
]
});
}

Prasanna Kumar Viswanathan [Syncfusion]
Replied On September 6, 2017 01:48 PM UTC

Hi Dan, 

Thanks for contacting Syncfusion support. 

We created a sample with your adaptor and we can reproduce the mentioned issue in our sample. In this you have mentioned the grid just hangs with a spinning circle. The spinning circle will displayed when we face any script error in console page. In our sample we faced script error in console page.  
 
In adaptor code example you have an method called convertToQueryString. In this method we get the object as undefined for the mentioned code(var obj = req.sort[0]). If the object has undefined then we will face script error while using Object.entries method. To avoid the script error, we suggest you to check the mentioned condition before the for loop. 
 
Find the code example and sample:  
 
 
convertToQueryString: function (req, query, dm) { 
                ------- 
                    var obj = req.sort[0] 
                    if (!ej.isNullOrUndefined(obj)) { 
                        for (var key in Object.entries(obj)) { 
                            str += '$sort[' + key + ']=' + value + '&' 
                        } 
                    } 
               } 
              return str 
            }, 
  

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.

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

;