//如果只需要一個子屬性從value出發
{field:'customer',title:'會員手機',width:100, formatter: function(value,row,index){ if (value.phone){ return value.phone; } else { return ''; } } },
//如果需要多個子屬性同時顯示(customer為一個類)從row出發
//自定義該類下屬性name為customerName
{field:'customerName',title:'昵稱',width:100,
formatter: function(value,row,index){
if (row.customer){
if(row.customer.name != '')
return row.customer.name;
else{
return '';
}
} else {
return '';
}
}
},
//自定義該類下屬性sex為customerSex
{field:'inventorySex',title:'性別',width:100,
formatter: function(value,row,index){
if (row.customer){
if(row.customer.sex!= '')
return row.customer.sex;
else{
return '';
}
} else {
return '';
}
}
},