Extjs gridpanel operation row to get the selected row, extjsgridpanel
Extjs gridpanel operation row to get the column of the selected row
Applicable to Extjs 3.2.0
Var model = grid. getSelectionModel (); model. selectAll (); // select all rows model. selectFirstRow (); // select the model of the first line. selectLastRow ([flag]); // select the last row. If the flag is positive, keep the number of currently selected rows. If this parameter is left blank, the default value is false model. selectNext (); // select the model of the next row. selectPrevious (); // select the model of the previous row. selectRange (startRow, endRow, [Boolean keepExisting]); // The row model between the selected ranges. selectRow (row); // select a row, starting from 0. selectRows (rows); // select the specified rows and pass the array such as [1, 3, 5]. Select 1, 3, and 5 rows of model respectively. clearSelections (); // clear all selected models. deselectRange (startRow, endRow); // cancel the select state model from startrow to endrow. deselectRow (row); // cancel the record grid of the specified row. getSelected (). id // obtain the id of the selected row
Obtain the selected row.
P62 pages in the book:
var sm=grid.getSelectionModel();
Var record = sm. getSelections () [0]; this indicates the selected row, with one s missing in the book.
Var record = sm. getSelections () indicates multiple selected rows and an array is obtained.
Accurate to the data of a specific column, record. get ("column name ").
Applicable to Extjs 3.2
var sm=grid.getSelectionModel();
var record=sm.getSelected();
Record is only a row of data. If you select good data, this will not work.
In Extjs, EditorGridPanel obtains information about controls in a cell.
1. the method for obtaining the control in a cell with the row number "colIndex" and the row number "rowIndex" is var compo = grid. getColumnModel (). getCellEditor (colIndex, rowIndex); 2. the method for obtaining the value of the control in the cell is var value = compo. getValue (); 3. if compo is a combobox control, the method for obtaining the data source of the control is var compoStore = compo. field. getStore (); 4. method for obtaining the Index of the selected combobox based on 3: var index = compoStore. find ('column name', value );