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
clientSide / xml with local sorting
19/03/2009
21:02
Avatar
expaand
Member
Members
Forum Posts: 7
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

Hi,

I would like to load an xml file but do clientSide sorting when a heading label is clicked. Is it possible to do that? There is no paging, or anything requiring a server.

It would seem that "datatype" can be either "xml" or "clientSide" - but I want a bit of both.

Thank you.

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

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

Hello,

Enjoy using the option loadonce:true. Also do not forget to set the appropriate sorttype in colModel. Read the docs

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.

23/03/2009
14:59
Avatar
expaand
Member
Members
Forum Posts: 7
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

Thanks, Tony. The "loadonce" option seems to be the exact one I need. However, when I put this in the xml file to load (via jqGridImport):

<loadonce>true</loadonce>

it doesn't really work - no errors, and it apparantly is not going back to the server, but when I click on a column to sort, nothing happens. If, on the other hand, I click on a link which fires a

jQuery("#xmlist1").setGridParam({datatype:"clientSide"});

the sorts all work.

So is this a bug in what I am doing? Perhaps loadonce doesn't work via jqGridImport? Or am I just doing the wrong thing?

Thanks!

David

24/03/2009
03:04
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It should work as any other option.

How is defined in the import the datatype parameter?

If you do not use import - is the grid woring in this case?

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.

24/03/2009
05:24
Avatar
expaand
Member
Members
Forum Posts: 7
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

Hi Tony -

The datatype is xml.

And I have not tried the grid without import. But everything works fine, except for the local sorting. And I can get the local sorting to work by one of the following two methods:

1. Once the grid is loaded, click on a link which is bound via

$("#s1").click(function() {
  jQuery("#xmlist1").setGridParam({datatype:"clientSide"});
});

or (so that local sorting is enabled automatically):

2. via

setTimeout("MyInit()", 400);

where MyInit() is:

function MyInit() {
  jQuery("#xmlist1").setGridParam({datatype:"clientSide"});
}

However, #1 requires manual intervention, and #2 is kludgy since you don't really know how long to wait for.

Thanks for your help,

David

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

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

Hello,

Could you please send me the xml configuration - in my email (and if possible some part of the data generated from the server). At best it will be good if you send me a link to the problem.

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.

28/03/2009
12:19
Avatar
expaand
Member
Members
Forum Posts: 7
Member Since:
19/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

Well, I got it all working after all (not sure what was wrong before). So if you want to enable local sorting, via jqGridImport:

<datatype>xml</datatype>
<loadonce>true</loadonce>

does the trick!

Thanks!

David

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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