jQWidgets Forums
jQuery UI Widgets › Forums › Grid › How to make JQXGrid rendergridrows make HTTP requests
Tagged: jqxgrid rendergridrows
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 4 years, 10 months ago.
-
Author
-
I would like to make the
jqxgrid.rendergridrows
method to send the HTTP request to the server and get a response viahttp.service
. But unfortunately it doesn’t work.
As the HTTP server returns the Observable I subscribe to it using:rendergridrows = (params: any): any[] => { this.http.getData(params) .subscribe(rows => { return rows; }); }
But I am getting an error since it looks like the
jqxgrid
doesn’t support the Observable.subscribe mechanism.
How to make it work? Here is the link to the Stackblitz project:I have tried to use all other methods to feed the data to the jqxgrid. I would like to have a pagination, and I want to use a single
http.service
instead of usingjqx.dataAdapter.url = "http://www.my-api.com/getdata"
. Please helpHello jqwidgetuser,
You use the
virtualmode
option which is relevant to therendergridrows
callback where the records are get from the jqxDataAdapter‘s source.
With the approach that you use the data that you try to get is asynchronous.
You could change it to the synchronous operation.
Also, I would like to suggest you look at this tutorial below which demonstrates how you could achieve a Server-Side Paging:
https://www.jqwidgets.com/angular-components-documentation/documentation/angular-serverside/angular-serverside-paging.htm?search=Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHow to make it asynchronous? The Server-Side Paging tutorial describes the approach when
jqxgrid
makes the http requests directly using itssource.url
parameter. But I would like to usehttp.service
for all the HTTP communications with the server. Please let us know if we can makejqxgrid.rendergridrows
asynchronous. Please use the Stackblitz project to illustrate your idea:
https://stackblitz.com/edit/github-nkeedt?file=src%2Fapp%2Fapp.component.tsHello jqwidgetuser,
These are two different approaches that I suggested to you.
But now I think the first one with the synchronous approach could not be handled.About the second one, the tutorial demonstrates how to bind to the server and make a Server-Side Paging.
Thank you for your understanding.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.