Multiple choice, How to obtain the row number of each line:
Function getlinenum (){
VaR Sm = titlegird. getselectionmodel (); // obtain the selectionmodel of the grid.
If (Sm. getselected ()){
VaR RECs = Sm. getselections (); // put all selected items in the array
VaR linenum; // The row number.
For (VAR I = 0; I <recs. length; I ++ ){
Linenum = titlestore. indexofid (RECs [I]. Get ("titleid"); // the ID of the current row gets the current row number
Alert (linenum );
}
} Else {
Ext. msg. getdialog (). setwidth (500 );
Ext. MessageBox. Alert ("prompt", "unselected record ...");
}
}
Single choiceIt is very easy to select a single row (for example, double-click or click an event ):
VaR linenum = titlegird. getselectionmodel (). lastactive;
Note:
The row number is actually the index of each row, starting from 0!
What is the use of a row number? For example, if a row number is obtained, it can be reversed. For example, if the row number is selected for the third row, but it does not meet the value transfer requirements, you can deselect it:
VaR linenum = titlegird. getselectionmodel (). lastactive;
Titlegird. getselectionmodel (). deselectrow (linenum );