jQWidgets Forums

jQuery UI Widgets Forums Grid Retrieving data from jqgrid

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 10 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Retrieving data from jqgrid #66034

    ashutosh27
    Participant

    I want to retrieve data from multiple rows by selecting in a jqgrid. The purpose is to retrieve all the rows selected, compare their ids with another table and fetch some other data. Can you please tell how to do this ?

    Thanks in advance,
    Ashutosh

    Retrieving data from jqgrid #66043

    Dimitar
    Participant

    Hello Ashutosh,

    You can use the method getselectedrowindexes to get the indexes of all selected rows. You can get an array of all loaded rows in the grid with getboundrows. Finally, use the indexes returned from the former method to get only the selected rows from the array returned by the latter, e.g.:

    var rowindexes = $('#jqxGrid').jqxGrid('getselectedrowindexes');
    var rows = $('#jqxGrid').jqxGrid('getboundrows');
    var firstSelectedRow = rows[rowindexes[0]];

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Retrieving data from jqgrid #66064

    ashutosh27
    Participant

    Hello Dimitar,

    Thanks a lot for providing me the solution. Can you please provide me an example code which I can refer to.

    Thanks,

    Ashutosh

    Retrieving data from jqgrid #66074

    Dimitar
    Participant

    Hi Ashutosh,

    Please check the following example: http://jsfiddle.net/Dimitar_jQWidgets/w64cb1ye/.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.