jQWidgets Forums

jQuery UI Widgets Forums Grid Get checked row values as preferred data type

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 11 months ago.

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

  • rskbuvan
    Spectator

    Hi,

    I’ve a requirement that, when a user edit any column in a row. Those edited rows will be selected using checkbox column manually and i’ve to get those checked row data for database update during button click.

    I can able to get the selected row data using the following method and it is working fine.

    $('#getSelected').click(function () {
    var rows = $("#jqxgrid").jqxGrid('selectedrowindexes');
    var selectedRecords = new Array();
    for (var iCount = 0; iCount < rows.length; iCount++) {
    var row = $("#jqxgrid").jqxGrid('getrowdata', rows[iCount]);
    selectedRecords[selectedRecords.length] = row;
    }
    });

    Here I can get the values as a array but I need each row values to be formatted in a preferred datatype like XML or JSON so that it will be easier to update it database i.e. I need the format in a such a way that I’m loading a data in a grid.

    For Example:

    <Users>
    <User>
    <checkrow>false</checkrow>
    <username>Peter</username>
    <companyname>ABC</companyname>
    <emailaddress>xyz@abc.com</emailaddress>
    <accounts>4 Accounts</accounts>
    <services>4 Services</services>
    <updatedate>01/03/2013 12:00:15 PM</updatedate>
    <hasaccess>Yes</hasaccess>
    <consumerid>10011</consumerid>
    </User>
    </Users>

    I want the selected row values to be structured in above format or is there any alternative option?

    Can anyone please help?

    Thanks in advance.

    Regrads,
    \_rssb


    Dimitar
    Participant

    Hello rssb,

    This can be achieved by exporting of the checked rows using the method exportdata. To learn more about it, please check out the demo Export Data and the documentation on the exportdata method in the jqxGrid API Reference.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.