jQWidgets Forums

jQuery UI Widgets Forums Angular Downloaded jqxgrid Data

This topic contains 1 reply, has 2 voices, and was last updated by  admin 5 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Downloaded jqxgrid Data #112314

    unicorn
    Participant

    The jqxgrid is set to download the json data from https://jsonplaceholder.typicode.com:

      source: any =
      {
        datatype: 'json',
        url: "https://jsonplaceholder.typicode.com/users",
        cache: false,
        datafields: []
      }
      dataAdapter: any = new jqx.dataAdapter(this.source);

    Once the json data is downloaded it is passed to the jqxgrid and jqxgrid is populated with the values.

    https://i.imgur.com/sx9dXr4.png

    When the user clicks the table’s row the onCellClick method is triggered. It is defined in the app.component.ts script:

      onCellClick(event: any): void | boolean { 
        // console.dir(this.myGrid);
    
        let rowindex =  event.args.rowindex;
        console.log("rowindex:", rowindex);
    
        let dataindex = this.myGrid.getrowid(rowindex)
        console.log("dataindex:", dataindex);
       
      }

    As you can see, I have the jqxgrid object there stored in the this.myGrid) variable which I queried with:

    @ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent;

    I am also able to access the row number the user has clicked using:

    let rowindex = event.args.rowindex;

    In addition, I would like to access all the json data that was downloaded by the dataAdapter. Where and how do I access the downloaded data?

    Also, I would love to know, how to access the columns values as well. Do I have to access the dataAdapter?

    StackBlitz Project used for this demo

    Many thanks in advance!

    Downloaded jqxgrid Data #112318

    admin
    Keymaster

    Hi,

    You may look at: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm

    The downloadComplete callback function of the dataAdapter might be useful here.

    Best Regards,
    Peter Stoev

    https://www.jqwidgets.com/

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

You must be logged in to reply to this topic.