Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get record from store selecting row in grid?

Tags:

extjs

extjs4

in extjs 3 I use:

    if (Model1.getSelectionModel().getSelections().length == 1 ) {
    record = Model1.store.getAt(Model1.getStore().indexOf(Model1.getSelectionModel().getSelected()))
 }
, but in extjs4 it's not work ...
like image 711
Bdfy Avatar asked Feb 25 '23 08:02

Bdfy


1 Answers

There is no getSelections() method in ExtJS4. You need to use the getSelection().

In previous versions you had:

  1. getSelection() -> Used to get the first selected record.
  2. getSelections() -> Used to the selected records.

In ExtJS4, you have only getSelection() which returns an array of the currently selected records. So you need to change your if statement. That should fix your problem.

extra note: Use the getStore() method to access the store rather than using the property name store.

like image 53
Abdel Raoof Olakara Avatar answered Mar 04 '23 00:03

Abdel Raoof Olakara