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
dilemma with scrolloffset
19/01/2010
18:12
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

If "scrolloffset = 0" and "autowidth=true" then I have an horizontal scrollbar.

If I don't want of that horizontal scrollbat then I must suppress "scrolloffset=0"

But ...

If the grid is empty or not full then there is a shift between the headers and the columns (already invoked in other threads)

Is is a dilemma or does a solution exist ?

22/01/2010
13:10
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Currently no. I understand what you mean.

Also one possible solution is to set height:'auto', which will resolve your problems.

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.

25/01/2010
11:41
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

No because I must scroll the window !

The whole grid is not visible anymore only on the screen.

May we expect one solution ?

26/01/2010
17:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

For now no, but you can analyze the number of columns in loadComplete and set the height to auto or to some value

something like

if(rowcounr>10) set grid height to auto

else set the grid height to 200px

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.

27/01/2010
19:42
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Like this ?

loadComplete: function ()
         {
            var r = jQuery("#list1").getGridParam('reccount');
            if (r > 6)
            {
                jQuery("#list1").setGridHeight('auto')
            }
            else
            {
                jQuery("#list1").setGridHeight(150)  
            } 
         }

But the height increases indefinitely !!!!!!!!

27/01/2010
20:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Try this

if (r <= 6)
 {
      jQuery("#list1″).setGridHeight('auto')
 }
     else
 {
      jQuery("#list1″).setGridHeight(150)  
 }

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.

29/01/2010
13:08
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

It's not suffisant: scrolloffset should be set to 0 (I think ...)

But It doesn't work ! with and without the trigger !!

if (r <= 6)
 {

      jQuery("#list1″).setGridHeight('auto');

      jQuery("#list1").setGridParam({'scrollOffset':0}).trigger("reloadGrid");   <<<<<<<<<<<<<<<<<<<

 }
     else
 {
      jQuery("#list1″).setGridHeight(150)  

//HOW TO SET SCROLLOFFSET TO DEFAULT ?
 }

01/02/2010
08:55
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The trick is to change the width with 1 pixel ,

using trigger("reloadGrid") is not needed.

if (r <= 6)
 {

     var wd  = .. get here the width of the grid

      jQuery("#list1″).setGridHeight('auto');

     jQuery("#list1″).setGridwidth(wd+1);

 }

.......

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.

01/02/2010
12:27
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I think we have a misunderstanding because your trick has no effect .

I always have an horizontal scrollbar if r > 6 !!!!!!!

I only want a vertical scrollbar if r > 6

loadComplete: function ()
         {
            var r = jQuery("#list1").getGridParam('reccount');
            if (r <= 6)
            { 
                jQuery("#list1").setGridHeight('auto');
                var w = jQuery("#list1").getGridParam('width');
                alert(w);
                jQuery("#list1").setGridWidth(w+1);
            }
            else
            {
                jQuery("#list1").setGridHeight(150) ;      <<<<<<<<<<<< horizontal scrollbar !!!!!!
            }  
         },

01/02/2010
13:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Forgot to say that the setGridwidth should be set on both

Try this

loadComplete: function ()
         {
            var r = jQuery("#list1″).getGridParam('reccount');
            var w = jQuery("#list1″).getGridParam('width');
            if (r <= 6)
            { 
                jQuery("#list1″).setGridHeight('auto');
                alert(w);
            }
            else
            {
                jQuery("#list1″).setGridHeight(150) ;      <<<<<<<<<<<< horizontal scrollbar !!!!!!

            }  

            jQuery("#list1″).setGridWidth(w+1);

         },

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.

01/02/2010
19:24
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Yes, but I shall remove scrollOffset=0

The final code is:

loadComplete: function ()
         {
            var r = jQuery("#list1").getGridParam('reccount');
            var w = jQuery("#list1").getGridParam('width');
            if (r <= 6)
            {
                jQuery("#list1").setGridHeight('auto');
            }
            else
            {
                jQuery("#list1").setGridHeight(150);
            }    
            jQuery("#list1").setGridWidth(w+1);
                 
         },

Thank you for your patience.

09/02/2010
19:46
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

The method is perfect … but only with one grid !

If you have two grids, the second doesn't change its height but "follows" the fiirst grid !

first grid:

loadComplete: function ()
     {
        var r = jQuery("#list1″).getGridParam('reccount');
        var w = jQuery("#list1″).getGridParam('width');
        if (r <= 12)
        {
            jQuery("#list1″).setGridHeight('auto');
        }
        else
        {
            jQuery("#list1″).setGridHeight(100);
        }    
        
        jQuery("#list1″).setGridWidth(w+1);
             
     }  

second grid:

loadComplete: function ()
     {
        var r = jQuery("#list2″).getGridParam('reccount');
        var w = jQuery("#list2″).getGridParam('width');
        if (r <= 12)
        {
            jQuery("#list2″).setGridHeight('auto');
        }
        else
        {
            jQuery("#list2″).setGridHeight(350);
        }    
        
        jQuery("#list2″).setGridWidth(w+1);
             
     }  

Then the height of the second grid will be 100 instead of 350 !

I also tried with r1=... and r2=... idem for w1,w2

Do you see the error ?

12/02/2010
18:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I do not see any error in the script, but I suppose this is not the original script - right?

Please check your script again.

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.

12/02/2010
20:29
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

It's an extract of the original script.

You mean that should work ?

17/02/2010
12:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Ok. Will check it.

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.

17/02/2010
20:01
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I forgot to say, scroll = true, for both grids

18/02/2010
18:30
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

I found this solution but it's not elegant !!!!!

first grid:

loadComplete: function ()
     {
        var r = jQuery("#list1″).getGridParam('reccount');
        var w = jQuery("#list1″).getGridParam('width');
        if (r <= 12)
        {
            jQuery("#list1″).setGridHeight('auto');

             jQuery("#list1″).setGridHeight(100);        <<<<<<<<<<<<<<
        }
        else
        {
            jQuery("#list1″).setGridHeight(100);
        }    
        
        jQuery("#list1″).setGridWidth(w+1);
             
     }  

second grid:

loadComplete: function ()
     {
        var r = jQuery("#list2″).getGridParam('reccount');
        var w = jQuery("#list2″).getGridParam('width');
        if (r <= 12)
        {
            jQuery("#list2″).setGridHeight('auto');

            jQuery("#list2″).setGridHeight(350);      <<<<<<<<<<<<<<<<<
        }
        else
        {
            jQuery("#list2″).setGridHeight(350);
        }    
        
        jQuery("#list2″).setGridWidth(w+1);
             
     } 

28/04/2010
00:51
Avatar
phicarre
Member
Members
Forum Posts: 132
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

In some occasion (I didn't identify it/them) the width increases endless !

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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