ExtJs / Sencha: how to highlight a grid line after insertion?

I want to create a grid like this: http://www.sencha.com/deploy/dev/examples/grid/edit-grid.html

Actually, I already did this, but I want to highlight the last inserted row of my grid (in extjs, this is the highlight () function, which executes the yellow element in the element).

I actually failed to do this ... my problem is that I cannot get the line I just inserted, and therefore I cannot select it. Any clues?

Thanks in advance

+3
source share
5 answers

You only need to do this (here for line number one):

var row = grid.getView().getRow(0);
Ext.get(row).highlight();

It is easy.

+7
source

Code has

store.insert(0, p);

, ?

+1

, Ext.grid.RowSelectionModel , selectLastRow, :)

+1

Ext.data.store , ,

add : ( Store this, Ext.data.Record[] records, Number index )

0

/. this.getSelectionModel().select(0); 0, 0. ExtJS 4.2.0.

    var rec = Ext.create('App.model.GridModel', {
        id: '123',
        name: 'ABC'
    });

    this.store.insert(0, rec);  
    this.getSelectionModel().select(0);
0

Source: https://habr.com/ru/post/1757642/


All Articles