Renderer usage and parameters in ext

Source: Internet
Author: User



SetHeader is the header of the set HTTP pleading is the extension of the MIME peace talks can be implemented in the following functions Ext renderer is generally used for grid in the column model is lined up with its specific information recorded in Ext.grid.ColumnModel Setrenderer ( Number col, Function fn)

First, Col:number
The column index
Second, fn:function
The function-to-use-process the cell "s raw data to return HTML-markup for the grid view. The render function is a called with the following parameters:
1, Value:object
The data value for the cell. (Value of the unit)
2, Metadata:object
An object in which the following attributes one can set the two properties below)
**css:string
A CSS class name to add to the cell "s TD element.
(Set the class name of the CSS for the TD element of the Unit)
**attr:string
An HTML attribute definition string to the apply to the data container element within the table cell (e.g. "Style=" color:red; "" " ).
(Increase the attribute of an HTML to the unit cell element)
3, Record:Ext.data.record
The Ext.data.Record which the data was extracted.
(The Ext.data.Record object for the field location row (whole note))
4, Rowindex:number
Row index (line number)
5, Colindex:number
Column index (number of columns)
6, Store:Ext.data.Store
The Ext.data.Store object which the Record was extracted.
(The data source object is the store/ds of the grid)
That's six parameters.


Renderer:function (value, Cellmeta, record, RowIndex, ColumnIndex, store) {

}
1.value is the value of the current unit cell
2.cellmeta is the Cellid unit Id,id is the column number, CSS is the unit of CSS style.
3.record is the row data, what you want, record.data["id" is obtained.
4.rowIndex is the line number, not the meaning of the number from the beginning, but the results after pagination.
5.columnIndex column number.
6.store, this is the DS you pass when you create the form, that is, all the data in the table, you can call it casually,

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.