Go The configuration and method of Ext grid control

Source: Internet
Author: User

1, Ext.grid.GridPanel
Main Configuration items:
Store: Data set for tables
Columns: Configuration array for tabular column mode, which automatically creates Columnmodel column mode
Autoexpandcolumn: Automatically fills the column with table unused space, the parameter is the column ID, the ID cannot be 0
Striperows: Table is color-interlaced, default is False
CM, Colmodel: Table column mode, the configuration item must be set when rendering a table
SM, Selmodel: Table selection mode, default to Ext.grid.RowSelectionModel
Enablehdmenu: Whether to display the table header context menu, default to True
Enablecolumnhide: Whether the column is allowed to be hidden through the context menu in the header, which is true by default
Loadmask: Whether the matte effect is displayed when data is loaded, false by default
View: Table view, default to Ext.grid.GridView
Viewconfig: Configuration object for Table view
Autoexpandmax: Maximum width of auto-expansion column, default is 1000
Autoexpandmin: Automatically expands the minimum width of the column by default to 50
Columnlines: Whether to display column split lines, default to False
Disableselection: Whether to prohibit row selection, default to False
Enablecolumnmove: Whether to allow drag-and-drop columns, default to True
Enablecolumnresize: Whether to allow column widths to be changed, by default True
Hideheaders: Whether to hide the table header, false by default
MaxHeight: Maximum Height
Mincolumnwidth: Minimum column width, default is 25
Trackmouseover: Whether to highlight the row where the mouse is located, the default is True
Main methods:
Getcolumnmodel (): Get column mode
Getselectionmodel (): Get selection mode
GetStore (): Get Data set
GetView (): Get View Object
Reconfigure (Ext.data.Store Store, Ext.grid.ColumnModel colmodel): Reconfigure table components with a new dataset and column pattern

2, Ext.grid.Column
main configuration items:
ID: Column ID
Header: Header text
Dataindex: Sets the correspondence between columns and data records in the dataset, The value is the field name in the data record. If the item is not set, the column index is used to correspond to the index of the field in the data record
Width: column width
align: column data alignment
Hidden: Whether column is hidden, default is False
fixed: fixed column width, false by default
Menudisabled: Whether to disable the context menu for a column, default to False
resizable: whether to allow column widths to be changed, default to True
sortable: whether to allow sorting, default to True
Renderer: Setting a custom cell render function for a column
parameters passed into the function are:
Value: The original value of the data
metadata: Metadata object that sets the style and properties of the cell that contains the attributes:
CSS: Style name applied to cell TD element
Attr: An HTML property definition string, such as ' style= ' Color:blue '
Record: Current data Record object
RowIndex: Row index of cell
Colindex: Column index of Cell
Store: DataSet object
Xtype: Column renderer type, default is GridColumn, other optional values are Booleancolumn, Numbercolumn, Datecolumn, TemplateColumn
Editable: Editable, default true
Editor: Editor
GroupName:
Emptygrouptext:
groupable:

3, Ext.grid.ColumnModel
main configuration items:
Columns: Field array
defaultsortable: Default sort, False
DefaultWidth: Default Width
Main method:
Findcolumnindex (String col): Find column index
Getcolumnbyid (string ID) based on the given Dataindex : Gets the column
getColumnCount (Boolean visibleonly) that corresponds to the specified ID: Gets the total number of columns
Getcolumnheader: Gets the header of the column
Getcolumnid ( Number index): Get column ID
getdataindex (number col): Gets the data field name for the column
Getindexbyid (String ID): Gets the column index
Gettotalwidth (Boo Lean Includehidden)
iscelleditable (number colindex, number RowIndex)
isfixed ()
Ishidden (number Colindex)
Setcolumnheader (number col, String header)
Setcolumnwidth (number col, number width, Boolean suppressevent)
setdataindex (number col, String dataindex)
seteditable (number col, Boolean editable)
Seteditor (number col, O Bject editor)
Sethidden (number Colindex, Boolean hidden)
Setrenderer (number col, Function fn)

4, Ext.grid.AbstractSelectionModel
Main methods:
Lock (): Lock Selection Area
Unlock (): Unlock selection area
IsLocked (): Whether the current selection area is locked

5, Ext.grid.CellSelectionModel
Main methods:
Clearselections (Boolean preventnotify): Clear Selection Area
Getselectedcell (): Gets the currently selected cell, returns an array with the format: [RowIndex, Colindex]
Hasselection (): Whether there is currently a selection area
Select (number rowIndex, number Colindex, [Boolean preventviewnotify], [Boolean Preventfocus], [Ext.data.Record R]): Select the specified Cell

6, Ext.grid.RowSelectionModel
Main Configuration items:
Singleselect: Whether it is Radio mode, default is False, that is, multiple data can be selected
Main methods:
Clearselections ([Boolean fast]): Clears all selection areas
Deselectrange (number StartRow, number Endrow): Cancels the row selection in the range
Deselectrow (number row, [Boolean preventviewnotify]): Cancels the selection state of the specified row
Each (function fn, [Object scope]): Iterates through all selection rows and invokes the specified function. The currently selected row is passed into the function
GetCount (): Total number of rows to be selected
GetSelected (): Get the first selected record
Getselections (): Gets an array of all selected records
Hasnext (): Determines if there is a record after the currently selected row can be selected
Hasprevious (): Determines if there is a record before the currently selected row can be selected
Hasselection (): Whether the data has been selected
isidselected (String ID): Determines whether the record of the specified ID is selected
isSelected (Number/record index): Determines whether data for the specified record or record index is selected
SelectAll (): Select All Rows
Selectfirstrow (): Select First row
Selectlastrow ([Boolean keepexisting]): Select the last line
Keepexisting: Whether to keep the existing selection
Selectnext ([Boolean keepexisting]): Select the next row of the current selection row
Selectprevious ([Boolean keepexisting]): Selects the previous row of the current selection row
Selectrange (number StartRow, number Endrow, [Boolean keepexisting]): Selects all rows in the range
Selectrecords (Array Records, [Boolean keepexisting]): Select a group of specified records
SelectRow (number row, [Boolean keepexisting], [Boolean preventviewnotify]): Select a row
Row: Line Index
Selectrows (Array rows, [Boolean keepexisting]): Select multiple rows
Rows: Row index array

7, Ext.grid.CheckboxSelectionModel
Main Configuration items:
Singleselect: Whether it is Radio mode, default is False, that is, multiple data can be selected
Checkonly: Whether you can only select by clicking the CheckBox column, default to False
Sortable: Whether to allow checkbox column sorting, default to False
The width of the Width:checkbox column, which defaults to 20

8, Ext.grid.RowNumberer
Main Configuration items:
Header: Line number list header display content
Width: column width, default = 23

9, Ext.grid.GridView
Main Configuration items:
Enablerowbody: whether to include line bodies
Sortasctext: Text description in ascending order in the table header menu
Sortdesctext: Text description in descending order in the table header menu
Columnstext: Text description for column in table header menu
AutoFill: Whether columns are automatically expanded to fill the entire table, false by default
Forcefit: Whether to force the table width to apply to the overall width of the table, prevent horizontal scroll bars, default to False
Main methods:
Focuscell (number row, number col): Moves the focus to the specified cell
Focusrow (number Row): Moves the focus to the specified row
Getcell (number row, number col): Gets the TD element corresponding to the specified cell
Getheadercell (number Index): Gets the TD element corresponding to the specified table header
GetRow (number Index): Gets the TR element corresponding to the specified line
Getrowclass (record record, number index, Object rowparams, store): Gets the style name attached to the table row
Record: The data Record object for the current row
Index: Indexes of the current row
Rowparams: A configuration object passed into the row template during rendering, which can be customized for the line body, which takes effect only when Enablerowbody is true, and the possible properties are as follows:
Body: HTML snippet rendered to the line body
Bodystyle: String applied to the line body TR element Style property
Cols: The value of the colspan attribute applied to the row body TD element, which defaults to the total number of columns
Store: Tabular Data set
Refresh ([Boolean Headerstoo]): Refresh Table Component
Scrolltotop (): Scrolling the table to the top

Go The configuration and method of Ext grid control

Related Article

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.