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
How to expand or collapse grid??
30/08/2009
22:46
Avatar
yummy
Member
Members
Forum Posts: 30
Member Since:
30/11/2008
sp_UserOfflineSmall Offline

Hi :

I want to expand or collapse grid in javascript.

I don't want to use the "Initial Hidden Grid" property to do this.

Because i will expand or collapse grid depends on the records is zero or not.

If the records is 0 => collapse grid, else expand it.

But i can't find a method to do it.

Any body can help me?

Thanks.

31/08/2009
09:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

It is again the common problem - which is the first the egg or the chicken?

- Also in order to check if you have records - the grid is already construct (expanded), since of the ajax call (we do not know initially how many records we have).

- If you make the grid initially hidden it is quite possible, that you have records in the view

and so on.

I think that there are two possible solutions:

1. Before to open the grid check if the current query has records. (The most clear way)

If this is the case construct the grid with hiddengrid:false otherwise hiddengrid:true

2. Use loadComplete event to check if you have records and then either use setGridState (currently this method is only in GitHub)

or trigger the click to hide/show grid button.

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

31/08/2009
22:40
Avatar
yummy
Member
Members
Forum Posts: 30
Member Since:
30/11/2008
sp_UserOfflineSmall Offline

Hi Tony : 

Thanks your great help.

I use the following method to do it.

$(".HeaderButton", $('#mygrid')[0].grid.cDiv).trigger("click");

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

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

Hello,

This is the most recommended and clear use.

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:
58 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