Highlight ExtJS grid selection

Hey, I need to scroll my ExtJS grid to the current selection, but I have no idea how to do this. I came across a link in the forum to make sure that the method is available but cannot find any information. Can anyone make any suggestions? Thanks

+5
source share
8 answers

Sorry, I'm really dumb. I just tried sureVisible and it works great.

+1
source

Unfortunately, secureVisible () has been removed from ExtJS 4. The most straightforward solution I have found is to use scrollIntoView (). In my case, it was after selecting a row based on the loaded value.

var rowIndex = store.find('fieldName', value);
grid.getSelectionModel().select(rowIndex);
Ext.fly(grid.getView().getNode(rowIndex)).scrollIntoView();

. , .

+9

:

grid.getView().focusRow(rowIdx);
+9

:

    grid.getView().getRow(rowIdx).scrollIntoView();
+4

grid.getView().getNode(rowIndex).scrollIntoViewIfNeeded();

ExtJs 4.X Ext.fly

+3

, , , bufferedRenderer.

, Ext JS 5 bufferedRenderer.

, .

grid.getView(). getNode (rowIndex) NULL, .

+1

ExtJS 6, Renderer.

        var record = grid.getSelectionModel().selected.getRange()[0];
        grid.getView().focusRow(record);
+1

In 4.2, at least use scrollIntoViewIfNeededfails if you are outside the buffered range in a buffered Renderer. The buffered Renderer has a convenient scrollTomethod to help with this task:

grid.getView().bufferedRenderer.scrollTo(index, true);

Scrolls and optionally selects the specified row index in a common dataset.

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.grid.plugin.BufferedRenderer-method-scrollTo

0
source

All Articles