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
Jsonstring with self-defined "records" or "total"
02/08/2010
14:57
Avatar
Taker
Member
Members
Forum Posts: 3
Member Since:
02/08/2010
sp_UserOfflineSmall Offline

Hi,

In XML and JSON for example, i can define "records" or "total", but not at jsonstring.

Here  jqgrid calculated it.

Could you modify jqgrid yet?

05/08/2010
08:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Why do you think so? Do you try to define page and totals in json string?

Just for your info there is no difference in jsonstring and JSON response in jqGrid - the are treated the same way.

Kind Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

06/08/2010
12:32
Avatar
Taker
Member
Members
Forum Posts: 3
Member Since:
02/08/2010
sp_UserOfflineSmall Offline

Hi,

Both will treated different.

Jsonstring will treated as local data.

        locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring";

"Total" und "records" have no influence in jsonstring.

Could you add an option, that allows this?

17/08/2010
23:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Not sure what you mean. locdata just determine that the localdata arry should be filled in order to be used into the future.

Just few rows bellow we have

addJSONData = function(data,t, rcnt, more, adjust) {

........................

    locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring";

..................

    ts.p.page = $.jgrid.getAccessor(data,dReader.page) || 0;
     lp = $.jgrid.getAccessor(data,dReader.total);
    ts.p.lastpage = lp === undefined ? 1 : lp;
    ts.p.records = $.jgrid.getAccessor(data,dReader.records) || 0;

....

}

Kind regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

18/08/2010
10:50
Avatar
Taker
Member
Members
Forum Posts: 3
Member Since:
02/08/2010
sp_UserOfflineSmall Offline

Hi,

yes, but then comes this:

...................................................................................

drows = $.jgrid.getAccessor(data,dReader.root);

if (drows) {
            len = drows.length; i=0;

.....................

if(locdata) {
   ts.p.records = len;
   ts.p.lastpage = Math.ceil(len/ rn);
}

....................................................................................

ts.p.records is the length of drows, and not what I have defined in dReader.records.

Do you know, what i mean?

Kind regards

18/08/2010
16:01
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Taker!

The datatype "jsonstring" is a form of holding of the local data in jqGrid where you load all the data in once. So having the number of records or the number of pages which not corresponds the data from the JSON string has no sense. If you want use data paging for example, you should use "json" data type.

It seems to me it would be better if you post a code example where you show in which situation you have the problem which you describe. Then one could change your code so, that the problem no more exist.

Regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
72 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