行添加操作列

rowformater方法可以扩展自定义列:

The cell formatter function, take three parameters:
value: the field value.
rowData: the row record data.
rowIndex: the row index.

Code example:

$('#dg').datagrid({
	columns:[[
		{field:'userId',title:'User', width:80,
			formatter: function(value,row,index){
				if (row.user){
					return row.user.name;
				} else {
					return value;
				}
			}
		}
	]]
});

 

posted @ 2014-11-01 17:09  kedarui  阅读(197)  评论(0编辑  收藏  举报