Home > Java > javaTutorial > Analysis of extjs gridpanel's technical explanation of obtaining selected rows from operation rows

Analysis of extjs gridpanel's technical explanation of obtaining selected rows from operation rows

巴扎黑
Release: 2017-07-24 14:46:44
Original
1919 people have browsed it

extjs gridpanel operates the row to get the column of the selected row

在Extjs 3.2.0上适合
Copy after login
var model = grid.getSelectionModel();  
model.selectAll();//选中所有行  
model.selectFirstRow();//选中第一行  
model.selectLastRow([flag]);//选中最后一行,flag为正的话保持当前已经选中的行数,不填则默认false  
model.selectNext();//选中下一行  
model.selectPrevious();//选中上一行  
model.selectRange(startRow,endRow, [Boolean keepExisting] );//选中范围间的行  
model.selectRow(row);//选中某一行,,,从0开始  
model.selectRows(rows);//选中指定一些行,传递数组如[1,3,5],则分别选择1,3,5行  
model.clearSelections();//清空所有选中  
model.deselectRange( startRow, endRow );//取消从startrow到endrow的记录的选择中态  
model.deselectRow(row);//取消指定行的记录grid.getSelected().id //得到选中的行的标识
Copy after login
<br>
Copy after login
得到选中的行。
Copy after login
书上的P62页:
Copy after login
 var sm=grid.getSelectionModel();
Copy after login
var record=sm.getSelections()[0];这个代表选择的一行,书上少了一个s。
Copy after login
var record=sm.getSelections()表示选中的很多行,得到的是一个数组。
Copy after login
精确到具体某一列的数据,, record.get("列名")。
Copy after login
适合Extjs 3.2
Copy after login
var sm=grid.getSelectionModel();
Copy after login
var record=sm.getSelected();
Copy after login
record只是一行数据。如果选择多好数据则这个不行了。
Copy after login

EditorGridPanel in Extjs gets the relevant information of the control in a certain cell

1. Get the control in the cell with column number colIndex and row number rowIndex The method is:
var compo= grid.getColumnModel().getCellEditor(colIndex, rowIndex);
2. Method to get the value of the control in the cell is:
var value = compo.getValue();
3. Assuming that compo is a combobox control, the method to obtain the data source of the control is:
var compoStore = compo.field .getStore();
4. Method to get the Index of the selected combobox based on 3:
var index = compoStore .find('column name', value) ;

The above is the detailed content of Analysis of extjs gridpanel's technical explanation of obtaining selected rows from operation rows. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template