datagrid中column中的formatter屬性


在這里紅色的部分field字段顯示得信息是,返回數據中的department得值,再此示例中因為返回數據是department是一個obj所以要用formatter屬性進行重新的字段名定義

var column_views = [
{field: 'user_id', title: '工號', width: 70, sortable: true, align: 'center'},

{# {field: 'knowtype', title: '類型', width: 100, sortable: true},#}
{field: 'name', title: '用戶名稱', width: 150, sortable: true, align: 'center'},
{field: 'department', title: '所屬部門', width: 200, sortable: true, align: 'center',
formatter:function(value, row, index){
return row.department.name
}},
{field: 'email', title: '用戶名稱', width: 70, sortable: true, align: 'center'},

//{ title: '操作', width: 100, sortable: true},
]

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM