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
jqGrid 3.6 - load once and never again with json
10/11/2009
12:27
Avatar
StErMi
Member
Members
Forum Posts: 3
Member Since:
10/11/2009
sp_UserOfflineSmall Offline

I've the last one release of jqGrid.

I want this features:

it have to load only once all the data and never ask it again to load again.

I'm using Yii framework so I don't have to do querys to SQL to load datas.

This is my example. I've an object $category.

In $category->elements i've all my elements.

So the count of element will be $count = count($category->elements) and so on.

When I have to iterete I will do

for ( $i = 0; $i < $count; $i++ ) {

$response[$i]['id'] = $category->elements[$i]->elementId

$response[$i]['cell'] = array( $category->elements[$i]->elementId,  $category->elements[$i]->title)

}

echo json_encode($response);

But it doesn't work ( nothing is loaded and the grid is "strange" )

Someone can gimme a simple example that fix my request and my code?

10/11/2009
12:47
Avatar
StErMi
Member
Members
Forum Posts: 3
Member Since:
10/11/2009
sp_UserOfflineSmall Offline

Sorry my fault. Now it works ( i set the width manually ).

Anyway I've a problem: it doesn't order at all when I click on some arrow ( up/down ). Does it order with ajax request requesting the new order or if I specify "load once" it order the records with it's own cached data in the script? 

Thank you very much ( i'm using the example load once in the demos )

11/11/2009
03:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Read the docs for client side sorting. Also in client side sorting you will need to set some other parameter in colModel in order to work this.

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

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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