Title:
In the DataGrid, see official Documentation:
Formatter |
function |
The cell formatter function, take three parameter: value:the field value. Rowdata:the row record data. Rowindex:the row index. |
Undefined |
Example:
{field: ' id ', title: ' ID ', width:100,align: ' Center ', formatter:function (value, row, index) {
Return ' <span style= ' color;red > ' + value + row.id + index + ' </span> ';
}}
Treegrid, inherited this attribute, but some changes, the official document did not explain, summed up a bit
Formatter |
function |
The cell formatter function, take the parameter: value:the field value.//the same as usual. Rowdata:the row record data.//seems to have added _parentid,status attribute (value is open|close) Rowindex:the row index.//Notice, this end has! |
Undefined |
Inspection code:
{field: ' id ', title: ' ID ', width:100,align: ' Center ', formatter:function (value, row, index) {
var xs = [];for (var p in row) {Xs.push (p + ": =" + Row[p]);} Alert (xs.join (' \ n ')); Return ' <span style= ' color;red > ' + value + row.id + index + ' </span> ';
}}
JQuery Easyui, DataGrid, Treegrid formatter parameter comparison row index