0
votes

I need to select grid row and fireEvent for rowClick after reload grid.

I tried like this,

var orderNo = 777;
// do reload grid

var gridLen = mygrid.store.getCount(); // it return 10

for (var i = 0; i < gridLen; i++) {
    if (pickno == mygrid.store.getAt(i).get("orderNo").trim()) {
    //mygrid.getSelectionModel().selectRow(i);
    this.getOrderGrid().getSelectionModel().getSelection()[i];
    mygrid.fireEvent('itemclick', mygrid, i, mygrid.store.getAt(i));
    }
}

but, it does not work.

anybody know how to select grid row, and run fireEvent?

Thank you!

1

1 Answers

1
votes

Instead of this.getOrderGrid().getSelectionModel().getSelection()[i] I think you should try

this.getOrderGrid().getSelectionModel().select(i);

By the way, why don't you explicitly use a named function to handle the itemclick event? If using it that way, you can call that function instead of manually firing the event.