jQuery UI Widgets Forums Grid Retrieve selected rows

This topic contains 4 replies, has 2 voices, and was last updated by  dujmovicv 8 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Retrieve selected rows #84604

    dujmovicv
    Participant

    Hi All,

    I’m using this feature to select multiple/all rows :
    Multiple rows select
    My question is how can I retrieve the selected rows ID’s in the ‘next’ page?

    Retrieve selected rows #84605

    Peter Stoev
    Keymaster

    Hi dujmovicv,

    By using getselectedrowindexes method.

    Example: http://jsfiddle.net/jqwidgets/ka3eupev/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Retrieve selected rows #84606

    dujmovicv
    Participant

    Hi Peter,

    thanks for your reply. Works fine. Is it possible to get instead of those indexes MY id :

    datafields: [
    	{ name: 'RecordID', type: 'number'},
    	{ name: 'company_name', type: 'string'}
    ],
    cache: false,
    id: 'RecordID',

    which is ‘RecordID’ ?

    Retrieve selected rows #84608

    Peter Stoev
    Keymaster

    Hi dujmovicv,

    There is API for getting rows in jqxGrid, too. “getrows” returns the rows in the Grid. You can use it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Retrieve selected rows #84613

    dujmovicv
    Participant

    Thanks for the guideline, but I’m afraid I need more specific help 🙂
    I have tried this :

    $("#getSelected").on('click', function () {
    	var rowindex = $('#jqxgrid').jqxGrid('getselectedrowindex');
    	var rowindexes = $('#jqxgrid').jqxGrid('getselectedrowindexes');
    	var data = $('#jqxgrid').jqxGrid('getrows', rowindexes);
    	alert(data.company_name + " " + data.RecordID);
    });

    what I get as a response is : undefined undefined
    I’m trying to get the data for ALL the selected rows…
    What I am doing wrong here?

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

You must be logged in to reply to this topic.