Forum

July 12th, 2025
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_Related Related Topics sp_TopicIcon
how to add a name:value pair to json data?
Tags: json
08/07/2010
15:09
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

Is it possible to add a name:value pair to the json reader like the 'page' and 'totals' ? there are data that apply to all rows, not just a single row.

How do I reference these values in the HTML/JS?

Any suggestions?

Thanks

08/07/2010
15:21
Avatar
Asshiah
Member
Members
Forum Posts: 74
Member Since:
27/04/2010
sp_UserOfflineSmall Offline

You can find what you need here:

http://www.trirand.com/jqgridw.....eving_data

You should specify some userdata in the jsonreader to match the json data your server return.

You can then get this data in the client side using jQuery("grid_id").getGridParam('userData') for instance.

10/07/2010
15:17
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

Thanks. I have put it in and am still not seeing the data. If I use the existing data pair like 'records' I get a valid value, but for the new pair the value is 'null'. The value is in the json string.

                    loadComplete:function(){
                        $("#run_date").val(jQuery("#list").getGridParam('rundate') );
                        var vrun_date = jQuery("#list").getGridParam('rundate') ;
                        alert(vrun_date );
                    },   

{"records": "2", "rows": [{"cell": ["12907001", "0", "on_us", ""11184877"",
"2797.40", "None", null

, null, null, "Cr Item Amt. Exceeds Avg. ", null,
"TEXCHEM CORP", "cust3", " ", " "], ""id"": "573891"

}, {"cell": ["12194001",
 "0", "on_us", ""11162914"", "372239.00", "None", null, null, null,
"Cr Item

Amt. Exceeds Avg. ", null, "AUTO EXPRESS FRONTERA NORTE SA",
"cust4", " ", " "], ""id"": "573890"

}], "rundate": "09-12-2009", "total": "2", "page": "1"}

Any suggestions?
31/07/2010
09:07
Avatar
Ed Valentine
Member
Members
Forum Posts: 32
Member Since:
23/10/2009
sp_UserOfflineSmall Offline

I am using the following as the test of what is returned and what is in the alert box is the function shown.

                    loadComplete:function(){
//                        $("#run_date").val(jQuery("#list").getGridParam('userData') );
                        var vrun_date = jQuery("#list").getUserData ;
                        alert(vrun_date );
                    },   

function () {
    var a = this[0];
    if (a.grid) {
        return a.p.userData;
    }
}

The following is in the json data :

"rundate":

"{rundate:09-02-2009}",

Any suggestions?

Thanks.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 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