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