Forum


22:46

30/11/2008

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.
09:36

Moderators
30/10/2007

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.
03:35

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66