PDA

View Full Version : Grid forcing focus when clicking rows



Lampei
2 Jul 2014, 5:45 AM
Currently using ExtJS 4.2

I am using a gridpanel to display some data from my backend. Very straightforward. I am rendering 2 links in 2 of those columns. If the grid is not completely "in view" to the user, when they click the links, it forces the entire grid to be "in view" and jumps down the page to show the whole grid before the action is taken on those links (opening in a new window). I also have an "actioncolumn" in the grid and when clicking that, it does *not* force the grid to be completely "in view" before performing that action. However, I didn't see a "render" function for items within an actioncolumn, just for setting icons.

Does anyone know a setting or override to prevent the grid from being completely visible before opening links that are contained within that grid?

Thanks!

Gary Schlosberg
10 Jul 2014, 12:29 PM
I'm a little unclear on what your aim is here. Are you wanting the grid to jump to show the entire cell being clicked on or wanting the grid to stay where it is? And the links are forcing a jump, but the actioncolumn clicks are not?

Lampei
11 Jul 2014, 5:33 AM
Sorry for the confusion.I want the grid (and what the person is viewing) to stay where it is.e.g. if only half the grid is showing (10 out of 20 rows), and I click on a link within the grid (something in row 6), I want the grid and the page to stay where they are and open the link (I have a target="_blank" on the links). This is currently what happens with the images in the actioncolumn (which is what I *like*).Current functionality in the grid, however, is, if the grid is only partially visible (e.g. 10 rows out of 20) and I click one of the rows (e.g. row 7), then grid comes fully into view (thus skipping the page down) so all 20 rows are visible and the link does not open. I must click the link one more time in order to actually open the link.

Gary Schlosberg
11 Jul 2014, 7:39 AM
OK, thanks for clarifying. And what is hiding part of the grid? I had assumed scrolling, but then how could the whole grid become visible?

Lampei
11 Jul 2014, 9:27 AM
It's just below the visible portion of the browser (the user has not scrolled it completely into view)e.g. We have a long page. The grid is in "section 2" (so there's stuff above and below it). The user has scrolled down the page and the grid has become partially visible (first 10 rows of 20 rows visible), but not completely visible in the browser. They click a link within the grid and the page jumps down so that the whole 20 rows are visible, but does not open the link. If they click the link again (now that all 20 rows are visible), the link opens.It is almost like something is being attached to everything in the grid, so that nothing is "clickable" unless the grid is completely visible. So you "click" the link, which does a "grid.focus()" skipping the page down, making the entire grid visible, which then removes whatever prevention there was for clicking the links. This behavior does not seem to happen for the "icon" that is attached in the actioncolumn.

Gary Schlosberg
12 Jul 2014, 12:22 PM
You might have a look at the Links Inside Grid Cells section on this FAQ page.
http://www.sencha.com/learn/grid-faq

It's an older page, but the issue may still be the same.