Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
json array from jqgrid
02/10/2012
06:22
Avatar
arpitha
New Member
Members
Forum Posts: 2
Member Since:
02/10/2012
sp_UserOfflineSmall Offline

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
    });

02/10/2012
21:10
Avatar
arpitha
New Member
Members
Forum Posts: 2
Member Since:
02/10/2012
sp_UserOfflineSmall Offline

please help me

02/11/2012
11:38
Avatar
prince
Member
Members
Forum Posts: 6
Member Since:
19/10/2012
sp_UserOfflineSmall Offline

hi ,

 You can try this.

var jsonData = new Array();

jsonData= $("#sample_id").jqGrid("getGridParam", "data");

jsonData is containg complete grid records. Now you can use jsonData according to your requirements.

Hope it works for you...

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information