Forum


06:22

02/10/2012

Hi there, I am kind of new and trying to find out how to get jsonarry data from grid. this is the I am getting grid data and it's populating correctly. But I need to get json array value from this code pass it to other function so that it will generate csv report.
Please help me.
Thanks in advance.
ivm4070Grid = jQuery("#ivm4070Grid").jqGrid({
datatype: "json",
url: '/mmk2/JSONBatch',
mtype:'POST',
editurl: '/mmk2/JSONBatch?grid_id='+filter.grid_id,
height: '100%',
width: 500,
colNames:['Fund', 'Pool','Gasb', 'Acct LDGR Num', 'Acct ID Num', 'Object Code', 'Acct Name', 'Money Market Balance'],
colModel:[
{name:'fund_id', index:'fund_id', width:'10', search:true, sortable:true},
{name:'pool_id', index:'pool_id', width:'10', search:true, sortable:true},
{name:'gasb_cd', index:'gasb_cd', width:'20', search:true, sortable:true},
{name:'acct_ldgr_num', index:'acct_ldgr_num', width:'20', search:true, sortable:true},
{name:'acct_id_num', index:'acct_id_num', width:'20', search:true, sortable:true},
{name:'obj_cd', index:'obj_cd', width:'20', search:true, sortable:true},
{name:'int_nm', index:'int_nm', align:'right', width:'30', sortable:true},
{name:'ytd_bal_amt', index:'ytd_bal_amt', align:'right', formatter:'currency', formatoptions:{decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2}, width:'35', sortable:true}
],
jsonReader: {repeatitems: false, root:"rows"},
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#ivm4070Grid').jqGrid('restoreRow',lastsel2);
jQuery('#ivm4070Grid').jqGrid('editRow',id,true);
lastsel2=id;
}
},
gridview: true,
altRows:true,
scrollrows: true,
rowNum: 20,
rowList: [20, 30, 50],
viewrecords: true,
sortname: 'fund_id,pool_id, gasb_cd, acct_ldgr_num,acct_id_num',
sortorder: 'asc',
pager: "#ivm4070FooterPager",
postData: filter,
hiddengrid: false,
autowidth: true,
shrinkToFit: true
});
Most Users Ever Online: 715
Currently Online:
38 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66