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