Extjs gridpanel operation row to get the selected row, extjsgridpanel

Source: Internet
Author: User

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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.