jQuery UI Widgets › Forums › Grid › How to control url
Tagged: datagrid component
This topic contains 2 replies, has 3 voices, and was last updated by admin 5 years, 7 months ago.
-
AuthorHow to control url Posts
-
With the
GridComponentdefined as:<jqxGrid #myGrid [source]="dataAdapter" [columns]="columns" [pageable]="true" [virtualmode]="true" [rendergridrows]="rendergridrows"> </jqxGrid>and:
export class GridComponent { columns: any[] = []; source: any = { datatype: 'json', datafields: [], url: 'http://localhost/getdata', cache: false, root: 'Rows', beforeprocessing: (data: any) => { this.source.totalrecords = data.TotalRows; } }; dataAdapter: any = new jqx.dataAdapter(this.source); rendergridrows = (params: any): any => { return params.data; } }Looking at the backend’s log running as Python Flask
http serverI can see that thegrid‘sdataAdaptermakes thehttprequest using the URL:http://localhost/getdata?filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=10&_=1591929189583Evidently, the supplied
source.urlhttp://localhost/getdatais appended with the parameters such asfilterscount,groupscount,
pagenum,pagesize,recordstartindexandrecordendindex.I wonder if there is a way to customize the URL used to make the http request. For instance, I would like to send the
usernameargument to the specifiedhttp://localhost/getdataurl. Where should I specify it?Hello jqwidgetuser,
I would like to suggest you look at this page:
https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm?search=dataadapter
Especially thedataobject and also theformatDatacallback.
Also, you maybe know but it could be useful this tutorial below, too:
https://www.jqwidgets.com/angular-components-documentation/documentation/angular-serverside/angular-serverside-filtering.htm?search=Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comHi jqwidgetuser,
Hope the reply of my colleague helps. Do you have any additional questions?
Best Regards,
Peter stoevjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.