Forum

December 3rd, 2009
You must be logged in to post Login Register

Search Forums:


 






Grid scrolls to top after selecting a cell

No Tags
UserPost

12:06
30/09/2009


steipete

Member

posts 3

Hi!


First thanks to tony, keep up your good work. And I'm happy to see that you like github (i was the one that recommended it to you :)


To the bug: On a grid that has so much entries that you need to scroll, if you select a cell, it will scroll to the top of the grid.

This effect appears only in Firefox and IE (both latest version), NOT in safari/webkit.

And I only get it if i enable cellEdit. The grid scrolls so that the editable cell is on the bottom. If the cell is not editable, it scrolls to the top.

Here is my javascript setup: http://pastie.org/636924


I belive that scrolling is NEVER something you want to get when selecting some entries.

The bug is both in the released 3.5.3 and your latest github version (as of now). (I built and minified it with pbor's ant script)


Best,

Peter

05:40
02/10/2009


tony

Sofia, Bulgaria

Moderator

posts 5872

Hello Peter,

Thanks.

I could not reproduce this bug with your settings.

1. You use maybe old version, since viewsortcols is array and not variable.

2. I'm interested what  updateTestcaseSelection() function do?

3. Not sure if this is applicable, but using both cell edit and inline edit is not a good idea.

If you send me link to the problem it will be very good.

Best Regards

Tony

09:48
06/10/2009


derekdg

Member

posts 3

I am also having an issue with this in FireFox 3.5 and IE 6,7 using jqGrid 3.5.3.


If you have a grid with enough rows to make the window scroll and you click into an editable field, the grid automatically scrolls up to the point where the editable row is now at the bottom of your window.


Here's my testing setup. Very basic just to recreate this issue: http://pastie.org/643776


Thanks!

Derek

02:21
07/10/2009


tony

Sofia, Bulgaria

Moderator

posts 5872

Hello,

I will test this, but the first that I see in the code is that a DOCTYPE declaration is missing:

Please read this : http://www.trirand.com/jqgridw…..to_install

Regards

Tony

19:02
28/10/2009


derekdg

Member

posts 3

Hi Tony,

I added the DOCTYPE declaration but the issue still happens.

Thanks

Derek

09:06
21/01/2010


sean

Guest

Post edited 09:27 – 21/01/2010 by sean
Post edited 09:27 – 21/01/2010 by sean


I have the same problem. The solution was to hack grid.celledit.js and comment out //if (!$t.p.knv) { $($t).GridNav(); }

11:17
22/01/2010


tony

Sofia, Bulgaria

Moderator

posts 5872

Hello,

Not sure if this is applicable solution, but if this works for you

Regards

Tony

15:25
28/01/2010


dajaney

Member

posts 15

Tony: This is still happening to me.


Using cellEdit, with FF on *Nix and IEX on Windows.


If you click in a cell to initiate the edit toggle, the page jumps up so that your selected cell is just under the viewable fold of the bottom of my browser window.


Is there a way to disable this?

15:55
28/01/2010


steipete

Member

posts 3

This is something serious and VERY annoying.


It's happening for me too. My company uses the app only with Chrome now because every other browser shows this weird scrolling bug.


Currently I'm using github head of mid january, i'll try out the fix from @sean.

16:51
28/01/2010


steipete

Member

posts 3

Yes, uncommenting the GridNav() fixes that issue. Thanks, sean!

17:00
28/01/2010


dajaney

Member

posts 15

Post edited 15:52 – 28/01/2010 by dajaney


If I comment out that line, the page scrolling/jumping is fixed. The escape and enter keys still work. However, the left, right, up, and down arrow keys no longer work for the grid and the user is forced to use their mouse to navigate the cells from then on. My users are utilizing the arrow keys when working with my grid.


So, we are close but I need a way to fix this issue without eliminating the arrow keys for cell navigation.

18:48
08/02/2010


dajaney

Member

posts 15

bump, any thoughts?

22:05
19/05/2010


pkane

New Member

posts 1

Here's a solution that is working for me:


At line 346 of grid.celledit.js:

var selection = $("<span style='width:0px;height:0px;background-color:black;' tabindex='0'><span…


Add "position:fixed;top:0px;left:0px" to the style attribute of the outer span.


The inner span is the element which responds to the up/down/left/right keyboard events and moves the selected cell. To do this, it needs to have the focus. When it is given the focus, FF and IE scroll the browser, if necessary, so that it is visible. If you are editing a long grid, the browser may scroll up since the hidden span is inserted at the top of the grid. My proposed solution fixes the span to the viewport so that it's always "visible", and the browser doesn't have to scroll.

19:33
24/05/2010


nayanjyotionline

india

Member

posts 7

I try to validate a simple Form but the Jquery Validation Plugin not woking when I use only Button not The Submit Button.
I can not use the Submit button there Because If I use submit Button After Submitting the form It take the Action and goes to Default page while my current form is comes from Ajax. I am very new to Jquery. Please Help its Urgent…
I am giving the files here.
index.html

<html>
<head>
<script src="jquery.js">
<script="jquery-validate-min.js">
<script="validation.js>
</head>
<body>
<form id="contact_form">
<table>
<tr><th>Name</th><td><input name="name" /></td></tr>
<tr><th>E Mail</th><td><input name="email" /></td></tr>
<tr><th><input type="button" name ="submit" id="form_sub" onclick="save"></th><td><input name="email" /></td></tr>
</table>
</form>
</body>
</html>

Now the validation.js file

function save(){

$("#form_sub").click(function(){
$("#contact_form").validate({
'rules':{
'name':{
'required':true,
'minlength':5
},
'email':{
'required':true,
'email':true
}
}
})
}


Everything works fine when we use input type="submit"…
But it not working when we use input type="button"


Any Idea how can Fix this?
I am new to Jquery … Please Help

03:27
01/09/2010


mercurio

Encinitas, CA, USA

New Member

posts 2

pkane's solution is working for me, too. Is there any chance this will make it into a future release? Alternatively, putting that outer span's style into the CSS would allow those of us who need this fix to implement it in CSS rather than patching the source.

09:45
03/09/2010


tony

Sofia, Bulgaria

Moderator

posts 5872

Hello,

Thanks. It seems that I have missed pkane  post.

Will test and if everthing is ok I will apply the fix.

Kind Regards

Tony

No Tags

About the jQuery Grid Plugin forum

Most Users Ever Online:

76


Currently Online:

sowenzhang

42 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 5587

Posts: 19658

Membership:

There are 3631 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 252

markw65 – 179

phicarre – 126

YamilBracho – 124

Renso – 109

Jim P – 101

Administrators: admin (35 Posts)

Moderators: tony (5872 Posts), Rumen[Trirand] (81 Posts)




Ads by Lake Quincy Media
Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information