jQuery UI Widgets Forums Grid How to control url

This topic contains 2 replies, has 3 voices, and was last updated by  admin 4 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How to control url #112249

    jqwidgetuser
    Participant

    With the GridComponent defined 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 server I can see that the grid‘s dataAdapter makes the http request using the URL:

    http://localhost/getdata?filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=10&_=1591929189583

    Evidently, the supplied source.url http://localhost/getdata is appended with the parameters such as filterscount, groupscount,
    pagenum, pagesize, recordstartindex and recordendindex.

    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 username argument to the specified http://localhost/getdata url. Where should I specify it?

    How to control url #112292

    Hristo
    Participant

    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 the data object and also the formatData callback.
    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 Hristov

    jQWidgets team
    https://www.jqwidgets.com

    How to control url #112346

    admin
    Keymaster

    Hi jqwidgetuser,

    Hope the reply of my colleague helps. Do you have any additional questions?

    Best Regards,
    Peter stoev

    jQWidgets team
    https://www.jqwidgets.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.