ExtJS Renderer (EXT)

Source: Internet
Author: User

Http://www.cnblogs.com/hanyun/archive/2012/04/17/2453438.html

var cm = new Ext.grid.ColumnModel (
[
New Ext.grid.RowNumberer ({header: "", width:20, align: ' center '}),
{header: ', align: ' center ', dataindex: ' Accountandroseid ', width:50, Sortable:true, hidden:true},
{header: ', align: ' center ', dataindex: ' Useraccountid ', width:50, Sortable:true, hidden:true},
{header: ' account ', align: ' center ', dataindex: ' UserAccountName ', width:200, sortable:true},
{header: ' role name ', align: ' center ', dataindex: ' Userrolename ', width:200, sortable:true},
{header: ' status ', align: ' center ', dataindex: ' Useraccountstateid ', width:200, Sortable:true, Hidden:true, Renderer:func tion ()}
"

renderer can format the data format that the column displays or display the final data as you customize the script (I understand that now
First look at the parameters in Renderer:function ()

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

   2.cellmeta is saved cellid cell id,id don't know what it is, it seems to be a column number, CSS is the CSS style of this cell.  
   3.record is all the data in this line, what you want, record.data["id", so you get it. &NBSP,
   4.rowIndex is the line number, not the meaning of the number from the beginning, but the calculation of the results after pagination.  
   5.columnIndex column number is too simple. &NBSP,
   6.store, this is a powerful, actually this is you construct the table when the DS, that is, all the data in the table, you can call freely, alas, It's amazing.

ExtJS Renderer (ext.)

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.